Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Week Base Grouping

Author  Topic 

Weekend
Starting Member

20 Posts

Posted - 2007-08-07 : 05:31:26
Hi

SQL Server 2000
Table_A, Col_1 datetime

I want a query to group the date on weeks.
Please advise how ?

Thanks
Jawad

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-08-07 : 05:36:07
[code]group by select dateadd(week, datediff(week, 0, Col_1), 0)[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-07 : 06:05:46
quote:
Originally posted by khtan


group by select dateadd(week, datediff(week, 0, Col_1), 0)



KH
[spoiler]Time is always against us[/spoiler]






Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-08-07 : 06:24:01
thanks Madhi


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -