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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Week numbers problem.

Status
Not open for further replies.

harwooddale

Programmer
Feb 7, 2003
40
GB
Hi,
I have a table that contains current week info and that works just fine.
We are going to amend the table so that each row contains summary data from the previous 12 weeks.
This is fine when I am doing an insert where the previous 12 weeks are in the same year.
What do I do if some or all of the previous 12 weeks are in the previous year?

Help Gratefully Appreciated.

James Boak


bat.gif
 
Ok James, let us try to understand this. You do an aggregate or something similar based on the past 12 weeks. So knowing today's date you are summarising from (SYSDATE -(12*7)) until SYSDATE and at some time you will be getting a situation where SYSDATE -(12*7) happens to be in previous year. However SYSDATE -(12*7) will give a date in a format like 'dd/mm/yyyy' so you should not really care whether you have crossed into previous year etc. Is this assessment correct? What actually are you storing in the table?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top