Lloyd wrote:

I would like to know one more thing, can I use these date and time
functions with comparison operators? Will they return the correct result
or as per the string comparison rules?


Lloyd,

You can use either the string comparisons with the text versions of the dates or numeric comparisons with the julian day numbers (floating point number of days since the julian epoch started). Both will give the correct sort orders. This is one of the best features of the ISO-8601 format date and time strings, lexicographic order is the same as date order.

If you store text date strings in your database you can do this:

   select * from t where date < '2006-07-04 18:00:10';

If you store the julian day numbers in your database you can do this:

   select * from t where date < julianday('2006-07-04 18:00:10');

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to