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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Half Hour Grouping 1

Status
Not open for further replies.

NewCrystalUser

Programmer
Nov 10, 2003
3
IE
My issue is that I have a number of records that I have to group by half hour. The records may exist or not but I need to display from the Start Time entered and the End Time entered for each half hour. I know how to group the records by each half hour only if the records exist.
For example
I enter start time 8:00 and end time 10:00 I have 4 records, 3 falls into the group 8:30 and 1 falls into the group 9:00. I want to display the following
8:00 0
8:30 3
9:00 1
9:30 0
10:00 0

Can someone please advise?
 
Grouping won't really work unless you take a professional approach and build a time table to left outer join to your data.

You might create 48 formulas or Running Totals and conditionally add hours if the time is correct for each 1/2 hour, and then conditionally suppress the half hours that aren't in your entered time span.

-k
 
Thanks a million for your quick response and useful suggestions. I had thought of creating a table and left joining on it nut have decided that I will only display existing records and group these by half hours as follows:
NumberVar MinExtract := Minute({END_DATETIME});
TimeVar AMDMins;
DateTimeVar GPResult;

If MinExtract < 30 then AMDMins :=
Time(Hour({END_DATETIME}),00,00) else
If MinExtract > 30 then AMDMins :=
Time(Hour({END_DATETIME}),30,00);

AMDMins;
 
Thanks a million for your quick response and useful suggestions. I had thought of creating a table and left joining on it but have decided that I will only display existing records and group these by half hours as follows:
NumberVar MinExtract := Minute({END_DATETIME});
TimeVar AMDMins;
DateTimeVar GPResult;

If MinExtract < 30 then AMDMins :=
Time(Hour({END_DATETIME}),00,00) else
If MinExtract > 30 then AMDMins :=
Time(Hour({END_DATETIME}),30,00);

AMDMins;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top