Subject | Re: Date in SQL |
---|---|
Author | Alexander V.Nevsky |
Post date | 2003-05-19T19:58:31Z |
--- In ib-support@yahoogroups.com, Thomas Miller <tmiller@b...> wrote:
database ;) Perhaps
WHERE Cast("contact"."registered" as Date) < '01/01/2003'
will help, but I'm afraid there are rows in both formats
'13/01/02' (mm/dd/yy format)
'01.13.02' (dd.mm.yy format)
which will cause exception so can be catched, but
'02/05/02' (mm/dd/yy format inserted meaning dd.mm.yy )
'05.02.02' (dd.mm.yy format inserted meaning mm/dd/yy)
which will silently cause wrong result
My condolence, Alexander.
> You are not searching for a date, you are searching for a string.You
> have ato
> string in a string field that looks like a date, maybe. If you want
> do searchesPoor Andrew, and dozen of vampires under the quilt to author of this
> on dates as dates, then you need to have a DATE column or TIMESTAMP
> data type column. Good luck!
database ;) Perhaps
WHERE Cast("contact"."registered" as Date) < '01/01/2003'
will help, but I'm afraid there are rows in both formats
'13/01/02' (mm/dd/yy format)
'01.13.02' (dd.mm.yy format)
which will cause exception so can be catched, but
'02/05/02' (mm/dd/yy format inserted meaning dd.mm.yy )
'05.02.02' (dd.mm.yy format inserted meaning mm/dd/yy)
which will silently cause wrong result
My condolence, Alexander.