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.
| Author |
Topic |
|
Babaksql
Starting Member
32 Posts |
Posted - 2008-11-12 : 02:11:40
|
| HiCould you please tell me how we can use the GROUP BY to group records based on a specific weekday such as Monday or Tuesday,.... Suppose that the field which represents the date is DateField. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-12 : 02:22:44
|
| GROUP BY DATEPART(dw,DateField) |
 |
|
|
Babaksql
Starting Member
32 Posts |
Posted - 2008-11-12 : 03:02:46
|
| I mean how we can group records weekly based on a pre-defined day of week. I know that by having GROUP BY DATEPART (ww, DateField), we can group records weekly. My question is how we can do it for a specific day, for example from each Tuesday to the next Tuesday. Thanks |
 |
|
|
malaytech2008
Yak Posting Veteran
95 Posts |
Posted - 2008-11-12 : 03:18:38
|
| use datepart in BETWEEN and AND and group by datefield.malay |
 |
|
|
|
|
|