Data Group on Week:
-
Hi i have following fields in a Table i want to group on month and week plz help me to build query. Userid,Value,Date,RefNo,Type now i have month function but i want to group on week. so what will be the query? Regards, Shahzad Aslam Software Engineer
-
Hi i have following fields in a Table i want to group on month and week plz help me to build query. Userid,Value,Date,RefNo,Type now i have month function but i want to group on week. so what will be the query? Regards, Shahzad Aslam Software Engineer
Hi Query will be Select datename(ww, getdate()) - which will give you week number of the given date.
Harini
-
Hi i have following fields in a Table i want to group on month and week plz help me to build query. Userid,Value,Date,RefNo,Type now i have month function but i want to group on week. so what will be the query? Regards, Shahzad Aslam Software Engineer
Try this out with ur values in place of ''08-03-2006' ------------------------------------------------------ select *,datename(mm,('08-03-2006')) as mnthName, datename(dw,('08-03-2006')) as wkName group by mnthName, wkName !!Hope so it should work :-D Bala, HeroITES, Gurgaon(India)
-
Try this out with ur values in place of ''08-03-2006' ------------------------------------------------------ select *,datename(mm,('08-03-2006')) as mnthName, datename(dw,('08-03-2006')) as wkName group by mnthName, wkName !!Hope so it should work :-D Bala, HeroITES, Gurgaon(India)
Thanx! its working. Shahzad Aslam Software Engineer