Subject | Date in SQL |
---|---|
Author | Andrew Neillans |
Post date | 2003-05-19T19:23:47Z |
Hi,
Hope this is the right place to ask...
I have been given the task of writing a number of SQL scripts on an
existing database, but one in particular is causing me grief.
The server is Firebird 1.02 I believe.
I have a table that stores contact details, with the registered date.
e.g.
title varchar(20)
firstname varchar(255)
lastname varchar(255)
address1 varchar(255)
etc
registered varchar(20)
I am trying to do a search and,say, list all the people registered
before 1st Jan 2003, so I tried the following:
SELECT * FROM "contact"
WHERE "contact"."registered" < '01/01/03'
But this returned some with the year 2003 which is not right (they
were May 2003 ;)).
Is it possible to do a date search on a varchar, or am I going to
have to try and find the original source of the application that runs
this database and change it? (Please dont say this .... :p).
Many thanks in advance!!
Andy
Hope this is the right place to ask...
I have been given the task of writing a number of SQL scripts on an
existing database, but one in particular is causing me grief.
The server is Firebird 1.02 I believe.
I have a table that stores contact details, with the registered date.
e.g.
title varchar(20)
firstname varchar(255)
lastname varchar(255)
address1 varchar(255)
etc
registered varchar(20)
I am trying to do a search and,say, list all the people registered
before 1st Jan 2003, so I tried the following:
SELECT * FROM "contact"
WHERE "contact"."registered" < '01/01/03'
But this returned some with the year 2003 which is not right (they
were May 2003 ;)).
Is it possible to do a date search on a varchar, or am I going to
have to try and find the original source of the application that runs
this database and change it? (Please dont say this .... :p).
Many thanks in advance!!
Andy