Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: WHERE clause DATE question
You can use the add_months function (or add_month, I don't have a manual
closeby).
Although the function name suggests otherwise, you can also go back x
months.
This is done by simply specifying a negative number.
eg. select cust_id from customer where last_order_date > add_months(sysdate, -6)
Hope this helps you.
Greetings
Thierry Brouwers
Rich D <rdolan_at_fraingroup.com> wrote in article
<7c9eep$v3$1_at_eve.enteract.com>...
> I need to create a view using a WHERE clause that involves a date column.
I
> would like to see records with a date within the last 6 months only. I
am
> assuming that I need to do something using SYSDATE, but I haven't seen
how
> to get what I need.
>
> Does anyone have any suggestions?
>
> Thanks,
>
> Rich Dolan
>
>
>
>
Received on Thu Mar 11 1999 - 16:20:20 CST