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
 Development Tools
 Reporting Services Development
 Help With Grouping

Author  Topic 

steve4134
Starting Member

24 Posts

Posted - 2011-02-05 : 13:37:00
My goal is the following. I would like to Group By date and have my report show one date as shown here


Date ------- Day -- Lifeguard --- CRM-- Total

2-5-11 --- Saturday ==== 5------ 2 -- 7
2-6-11 --- Sunday ===== 3------ 8 -- 11


For the love of me I can not get it to group correctly. I am using sql 2005 and visual studio 2005. I have included some print screens below as well. Any help is appreciated.

Steve





dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-02-05 : 16:09:44
Instead of date AND a datename column use this a concatonation of the two instead:

SELECT convert(char(10),a.[CREATIONDATE],101) + ' ' + DATENAME(DW,CREATIONDATE)

would return 1 column with date and weekday and you could group by same.



Poor planning on your part does not constitute an emergency on my part.
Go to Top of Page

steve4134
Starting Member

24 Posts

Posted - 2011-02-06 : 00:15:39
Required to be separate by requester.

steve
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-02-06 : 07:19:43
Remove the time element from the datea column then, and that would do it. It is the time element that makes the multiple rows occur..

dateadd(d,0,datediff(d,0,creationdate))



Poor planning on your part does not constitute an emergency on my part.
Go to Top of Page
   

- Advertisement -