Dates
Table of Contents


EuSQL has several built-in facilities for dealing with dates using the DATE_TIME datatype. In an insert or delete query, when working with a DATE_TIME field, you should put the DATE_TIME inside of quotes. The format must be:
       YYYY-MM-DD HH:MM:SS
You do not need to include all portions of the date-time (or leading zeroes). Any omitted parts will be set to zero. For instance, the following are all valid DATE_TIMEs:
    2006-1-11 09:10:33
    2006-01-11
    2006-1-11 9:11
    2006-1
When using a DATE_TIME value in a WHERE clause, any literal DATE_TIME value should be wrapped in the DATE_TIME function so that EuSQL will recognize it as a DATE_TIME datatype:
    SELECT ORDER_NUM FROM SALES WHERE ORDER_DAY = DATE_TIME( '2006-01-10' );
See also the documentation on date related functions:

 
 
Parent Topics:
  • Data
  • Datatypes