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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 query help please

Author  Topic 

jql
Starting Member

30 Posts

Posted - 2010-12-31 : 05:53:19
Hi

i am trying to create a report that shows the open number of cases per day for a given period.
the query works where the referral date is less than @date but the end date is greater than @date or is null.

i have got the query to work where @date = 30-dec-2010 but am having trouble getting a day by day total for dates 27-dec-2010 to 30-dec-2010.

i am guessing i need to add in a date for each day but have no idea how to achieve this

the results i would like to see are as follows

date total
27/12 45
28/12 52
29/12 48
30/12 53

any help would be appreciated
Regards

Sachin.Nand

2937 Posts

Posted - 2010-12-31 : 07:24:24
add a group by clause on the date column.

PBUH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-12-31 : 09:53:08
Can you post the code you are using?

Madhivanan

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

- Advertisement -