Oracle generate list of IW week dates

http://stackoverflow.com/questions/10354600/oracle-generate-list-of-iw-week-dates

Oracle generate list of IW week dates

Goal: Output a list of IW standard week dates for a given time range based off of the current date.

Desired output: with Current date = 4/27/2012, list of past 7 IW week dates

enter image description here

 

 

Try this:

    SELECT TRUNC(SYSDATE - (LEVEL * 7), 'IW') TheDate
      FROM dual
   CONNECT BY LEVEL <= 7
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s