Thanks for the link to the doc

Quote Originally Posted by jefftee View Post
Not sure exactly where else you read that, but it's exactly what I said in my prior post.
I know it was in your prior post but its also posted on stackOver flow, tutorialspoint and other forum help sites but some of the explanations where confusing. I appreciate you bring this up as it is an important feature to know when dealing with dates.

Your original example shown the comparison was done in SQL using the BETWEEN operator. If your example has changed and you haven't re-posted your code, you might want to consider that or else you leave us all dazed and confused when you make statements that aren't supported by the example code you post.
I wasn't fully understanding the BETWEEN operator sorry for the confusion your right

You're stuck with the format required by the database engine you chose, which in this case is SQLITE. Make it easy on yourself and store the date/time data in one of the supported (and documented) formats. You can read the date/time data from the database and show in any format you desire, but the key is you need to store date/time data in a format the database will recognized it as date/time data.
Thank you for explaining this!

I can't figure out what your new problem is, but if I had to guess, it's because you haven't stored data in one of the documented date/time formats and so SQLITE is doing pure lexical comparisons of what you want to be treated as date/time data. i.e. in your desired format, you want 10-06-2016 > 10-07-2015. Since it's not stored in a supported SQLITE date/time format, SQLITE winds up doing a comparison based on lexical order, which means that 10-06-2016 < 10-07-2015, clearly not what you expect.

The supported/recommended date/time formats like 2016-10-06 vs 2015-10-07 is 1) recognized as a date/time value and 2) lexical order comparison works as you would expect. This is *not* a coincidence.

Edit: Now I see you have started a new post with the same topic... sigh...
I was messing several things up mainly formatting with your help though I think I got my issues cleared up, sorry for the double post again thanks Jeff

update: I will try you sqlite sqcript suggestion for select date range with time e.g.
Qt Code:
  1. date('now','localtime')||' 00:00:00.000' and date('now','localtime')|| '23:59:59.999'"
To copy to clipboard, switch view to plain text mode 

update: above sqlite script executes fine I would have never been able to figure out that syntax thanks!