Question Locked

Remaining Months in the Year

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I am looking for dynamic SQL to return the current month and the months left in the year dependant on the current month. So if I ran it today I would want to return Sept through to Dec.
The results would look like this
9/1/2009
10/1/2009
11/1/2009
12/1/2009

Any help would be appreciated

2 replies

by john.a.wills

Select date
from whatever
where month_number (date) >= month_number (sysdate) and year (date) = year (sysdate);
That is the required SQL structure, you will need to look up the actual functions yourself.

This discussion is closed to new replies.