Thursday, February 9, 2012

All dates between the start and end date

Table Data/Structure

Name

StartDate

EndDate

HrsWorked

Rick

01/01/2006

08/01/2006

8

Mike

02/01/2006

11/01/2006

8

How can I create a report that will display all dates between the StartDate and the EndDate and in the column underneath the date, put "8 hrs worked."

Jan0106

Jan0206

Jan0306

Jan0406......

8

8

8

8

0

0

0

0......Till Mike's start date in February

Thanks

-Rob

You're talking about generating data thats not contained in but can be derived from the dataset.

Your best bet is to do this in your query and return a row for every day and person. This looks like a job for a stored procedure or table valued function that will populate a temporary / in-memory table and return that as the dataset for the report.

No comments:

Post a Comment