Hi. I'm having trouble using SQL statements against an Oracle 9i database that has SYSDATE in the where clause (returns the current date/time - I believe it is equivalent to getdate() in SQL Server). With logging turned on, I see that the SQL statement parser always translates SYSDATE as a column of the table that is being queried, but actually it is a function that is called as a pseudo-column from the DUAL table (as in SELECT SYSDATE FROM DUAL).
So if I say SELECT MYCOLUMN FROM MYTABLE WHERE MYDATE > SYSDATE, the translation is something similar to SELECT MYTABLE0_.MYCOLUMN FROM MYTABLE MYTABLE0_ WHERE MYTABLE0_.MYDATE > MYTABLE0_.SYSDATE. The problem of course is that SYSDATE is not a column of MYTABLE, so Oracle returns an error that the column is unspecified.
Is there another way to search record via dates when using Oracle?
Cheers,
Curtis Olson
|