I need to filter my list based on date time.

Example: "people who purchased 180 days ago"

However I need that the comparison be with actual date (system date), so that I don't have to filter manually every day.

1

There are 1 best solutions below

5
On BEST ANSWER

Subtract 180 from (truncated?) SYSDATE:

select whatever
from your_table
where date_column < trunc(sysdate) - 180;

Why truncate? Becuase sysdate function returns both date and time, so - you'd probably want to "remove" the time component.