Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I notice that in your first example, the simple <strong>:order => "date"</strong>, record <strong>7</strong> is sorted before record <strong>1</strong>. This order is also how you see the results in the multi-column sort, regardless of whether you sort by attending.</p> <p>This would seem to make sense to me if the dates weren't exactly the same, and the date for <strong>7</strong> is before the date for <strong>1</strong>. Instead of finding that the <strong>date</strong>s are exactly equal then proceeding to sort by <strong>attending</strong>, the query finds that the dates are not equal and simply sorts by that like all the other records.</p> <p>I see from browsing around that SQLite doesn't have a native understanding of DATE or DATETIME data types and instead gives users the choice of floating point numbers or text that they must parse themselves. Is it possible that the literal representation of the dates in the database are not exactly equal? Most people seem to need to <a href="http://www.mail-archive.com/sqlite-users@sqlite.org/msg30166.html" rel="noreferrer">use date functions</a> so that dates behave like you would expect. Perhaps there's a way to wrap your order by column with a <a href="http://www.sqlite.org/cvstrac/wiki/wiki?p=DateAndTimeFunctions" rel="noreferrer">date function</a> that will give you something concrete to compare, like <strong>date(date) ASC, attending DESC</strong>. I'm not sure that syntax works, but it's an area to look at for solving your problem. Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload