RSS Forums RSS
Please support our MS SQL advertiser: Programming Forums

query for creating report group by weeks (with start date and end date of the week)

Join Date: Feb 2007
Location: London
Posts: 114
Reputation: davidcairns is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 8
davidcairns davidcairns is offline Offline
Junior Poster

Re: query for creating report group by weeks (with start date and end date of the week)

  #8  
Apr 23rd, 2007
Sorry about the missing parameter, my mistake. The datepart parameter dy represents the Day of the Year (1 to 366), there are a number of other options for this parameter that get various peices of the date. Using wk will get the
week, but it uses Monday as day 1, so it doesn't start on the 1st of January, in fact in 2006 the 2nd was in week 2.

What you did appears to be correct, assuming your data lay between the 15th and 21st of January. Try adding a few other lines and see what happens
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 9:05 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC