cancel
Showing results for 
Search instead for 
Did you mean: 

Group by day - evaluation date formula question

Former Member
0 Kudos

Hello,

I am currently working on a report for on-call coverage. I am having difficulty grouping by date and I'm hoping someone can help me. Here is my situation.

The on-call database has a coverage start date and coverage end date.

Person A has a coverage start date of 9/1/2009 and a coverage end date of 10/5/2009.

Person B has a coverage start date of 9/15/2009 and a coverage end date of 10/10/2009.

The report I am trying to create needs to be grouped by the calendar day of coverage. What I mean is, I need to be able to evaluate the coverage for a particular day.

If I run the report for the evaluation date of 9/10/2009, it would show Person A, their coverage start date and coverage end date.

If I run the report for the evaluation date of 9/20/2009, it would show Person A and Person B, with their respective coverage start and end dates.

My question is, how do I create this evaluation date?

Since this is a report for on-call coverage, I will also need to run this evaluation date into the future to confirm that there aren't any gaps in coverage.

What I need to do is run this report for so the evaluation date would be for the next month. So if I ran the report today, it would show me the on call coverage for November 2009, grouped by day.

Any help you can provide would be greatly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can create a parameter for your date, and then use the select expert.

{?DATE} in to

Based on the date you enter, it will show you the appropriate records.

Former Member
0 Kudos

V361,

Thanks for the help. This solves a portion of my problem.

How can I group this by the evaluation date created by that parameter, so it shows all the entries by day sequentially? i.e., Nov. 1, Nov. 2

Edited by: Mikhail Morales on Oct 5, 2009 9:29 PM

Former Member
0 Kudos

You will need a calendar-type table, with one record per date. Then, base your report on something like (MS SQL):


select calendar.date, on-call.name
from calendar, on-call
where calendar.date between '{?lowDate}' and '{?highDate}'
and calendar.date between on-call.start_date and on-call.end_date

The first condition of the Where clause selects all of the dates that you want to report. The second selects each person on-call for each of the dates from the calendar.

You could also code a loop in the SQL Command, but calendar tables are really quite handy. (For example, to indicate what dates are company holidays, where no on needs to be on call...) I'd suggest setting one up if you don't have one available.

HTH,

Carl

Answers (0)