Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

# of Classes Per Hour 1

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
US
I'm using crystal 9 with csv file.

I have a start_time and end time. I need to find out how many classes per hour so:

Example of csv file:

class start_time end_time

1-1 8:05:00 9:25:00 - so this class would be counted in the 8 and 9 am hours

2-2 8:30:00 9:30:00 - so this class would be counted in the 8 and 9 am hours

3-3 8:00:00 17:00:00 - so this class would be counted in the 8, 9, 10, 11 am, 12 pm, 1, 2, 3, 4 pm hours

4-4 18:00:00 10:00:00 - so this class would be counted in the 6, 7, 8 and 9 pm hours

Hour # of Classes
8am 3
9am 3
10am 1
11am 1
12pm 1
1pm 1
2pm 1
and so on

Help is appreciated.
 
You'll need to do a set of running totals, eack of which counts a class if its start date or end date are within the range, OR if start date is before and end date is after.

Best to create the tests first, as a boolian (no IF .. THEN). Put the tests on a test report with the data, and check they say True or False as expected. Then use them in running totals.

No choice about creating a lot of running totals. You can save a little time by doing a paste to a dummy report, changing the name and then pasting back.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top