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!

Group by week() 1

Status
Not open for further replies.

tbonehwd

IS-IT--Management
Jul 28, 2005
45
US
I have queries that group by year() and by month() so I just assumed that I could group by week() well I guess I am wrong. If it can be done how do you group by week()

Thanks,

Terry
 
Select Format(SomeDate, "ww") As theWeek, ...

From ...

Group By Format(SomeDate, "ww")
 
And if the data span several years:
Format(SomeDate, 'yyyy-ww') As theWeek

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top