Date Formats
[Previous] [Main] [Next]

Turbo SQL offers two different notations for date literals. The native format is dd.mm.yyyy. This format is a very logical one and can not be mistaken by the parser for arithmetic calculations. For this reason, it is not necessary (and even not allowed) to enclose such a date literal in quotation marks. Example:
SELECT *
FROM orders
WHERE saledate <= 31.12.2001
searches for sales on 31 December 2001.

If you prefer to enter the date in the American or international format, i.e. like 12/31/2001 or 2001-12-31 you have to enclose the date in double quotes:
SELECT *
FROM orders
WHERE saledate <= "12/31/2001"
or
SELECT *
FROM orders
WHERE saledate <= "2001-12-31"

Leading zeros for the month and day fields are optional. If the century is not specified for the year, TurboDB assumes the 20th century for years from 50 to 99 and the 21th century for years from 00 to 49.

Example:
SELECT *
FROM orders
WHERE (saledate > 1.1.89) AND (saledate <= 31.12.20)
searches for sales between the 1st January 1989 and the 31 December 2020.