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

Years, Months, Weeks

Status
Not open for further replies.

Ozrodent

Technical User
Jul 31, 2002
7
AU
Its just TOOOOO hard for me

Is there a way to sort data into YY MM ww as a result, what i need is, if the years data is complete, ie last year gives me an average for the whole year. then this year would then be broken up into months, up until august(full month averages) then september would then be broken in to weeks. This has got me stuffed all i have managed to do so far is one query for each value that i need but it seems to be the long way around.


Any help would be appreciated

OzRodent
 
Hi

The function Month() will return the month Number of a given date (ie 1-12)

The function Year() will return the year number of a given date

If by week you simply mean that sept 1 thru 7 is weeks 1, 8 through 14 is week 2 and so on, then a bit of dividing by 7 and the function Day() which returns the day of the month should give you what you want.

By using the above functions to derive calculated columns in your query it should be possible to get what you want.

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top