Subject Re: [firebird-support] Re: Date problem in Firebird
Author Pavel Menshchikov
Hello,

b> The other date problem that I have run across is the use of a
b> regular date syntax within in SQL statement.

b> ie.
b> SELECT FROM mytable WHERE mydatefield > 1/01/2004;
b> This results in this error: conversion error from string "0".

b> Is there a way to get regular date to work in 1.5 WITHOUT casting or
b> some function use.
Yes. You should quote the date:
SELECT FROM mytable WHERE mydatefield > '1/01/2004';
I think FB recognizes 1/01/2004 as a divisions of integers.
AFAIR, '/' separator is used for US date format (mm/dd/yyyy), and '.'
separator is used for European date format (dd.mm.yyyy), and
"universal" date format is yyyy-mm-dd.

b> I'm converting from sereval other databases and this type of SQL
b> statement is standard.
Are you sure that your sintax is SQL standard compliant? If some DB
engines support such sintax, it doesn't mean that the sintaxt is
standard-compliant. (I don't know if it is.)



HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com