Click to See Complete Forum and Search --> : [RESOLVED] Problem with simple where statement!


Funkymonkey
08-23-2006, 04:53 AM
FROM Table
WHERE Date >= 01/01/2006
AND Date <=01/08/2006

There is definately data in my table that corresponds to this statement. The part in blue works and the part in red doesn't.


It doesn't matter what dates I put in the second part of the statement, it still wont find anything. It's driving me mad!

Thanks!

Funkymonkey
08-23-2006, 06:14 AM
It seems i needed quotes. Thanks anyway!

sridhar_423
08-23-2006, 06:41 AM
if you're using Oracle Database, then I bet that your query will definetely give some junk if at all it gets executed. For Date comparisions, u need to convert the string into date.
Date >= to_date('01/01/2006','dd/mm/yyyy')

provided Date is a date type in the table.
No meaning for the query in case Date is a varchar type in the table.