On Thu, Sep 06, 2001 at 05:15:50PM +1000, Mike Withers wrote:
> Hi everyone
>
> I have a problem with SELECTs using dates and WHERE.
> Some examples:
>
> db2001=# SELECT * FROM emp WHERE hiredate > 1981;
1981 is not a valid date.
> db2001=# SELECT * FROM emp WHERE hiredate > 1981-01-01;
1981-01-01 = 1979 which is also not a valid date.
Try putting quotes around the date, like:
SELECT * FROM emp WHERE hiredate > '1981-01-01';
You'll find it works much better.
--
Martijn van Oosterhout <kleptog@svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.