Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query help w/ fiscal calendar query

Status
Not open for further replies.

ssmith999

Programmer
Nov 27, 2006
1
US
I am hoping someone can lend me a hand with this query. I need to query what fiscal week a given date falls in based on a fiscal calendar that starts Jan 29, 2017

Week 1 JAN 29 - FEB 04
Week 2 FEB 05 - FEB 11
Week 3 FEB 12 - FEB 18
etc...

So if the date in my table is Feb 14, the query would return Week 3.

Thanks in advance.
 
Use the below to determine the number of days and ceiling is a round up:
select CEIL((to_date ('your date','dd-MM-yyyy') - to_date('01-29-17','dd-MM-yyyy'))/7)
from dual;



==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top