SQLTeam.com | Weblogs | Forums

How to count workload each day


#1

Hi, I have a table of data (Jul-Feb) I would like to calculate for each day my workload:

Project No. Start Date End Date
1 01/07/15 04/07/15
2 01/07/15 03/07/15
3 01/07/15 06/07/15
4 02/07/15 06/07/15

what I would get to get as a result is
Date Projects
01/07/15 3
02/07/15 4
03/07/15 4
04/07/15 3
05/07/15 2
06/07/15 2
07/07/15 0

Any help would be appreciated!!


#2

Please refer to your other thread


#3

You can also try this to count the number of records in a day.

 select DateAdded, count(CustID)
from Responses
WHERE DateAdded >=dateadd(day,datediff(day,0,GetDate())- 7,0)
GROUP BY DateAdded