Search code examples
sqloracleoracle10goracle9idate-arithmetic

Oracle SQL Where Clause against a date column


I have a DATE column with a date in it but I need to query it to find records less than 30 days old.

START_DATE
----------
01-AUG-2010
09-AUG-2010
22-AUG-2010
09-SEP-2010

Query:

SELECT START_DATE
 WHERE START_DATE < 30;

I know it is simple Query in ORACLE SQL but i am doing something wrong.


Solution

  • WHERE START_DATE > SYSDATE - 1

    or perhaps

    WHERE TRIM(STARTDATE) > TRIM(SYSDATE) - 1