Search code examples
sqloracle-databasedate-comparison

Oracle Date Comparsion


I have a column in TableA which contains date as Varchar2 datatype for column Start_date.( '2011-09-17:09:46:13').

Now what i need to do is , compare the Start_date of TableA with the SYSDATE, and list out any values thts atmost 7days older than SYSDATE.

Can any body help me with this isssue.


Solution

  • You may perform the below to check the date:

    select * from 
    TableA
    where
    to_date(start_date,'YYYY-MM-DD') between sysdate and sysdate-7;