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

Time formula

Status
Not open for further replies.
Nov 18, 2002
15
US
I am trying to create a report which would produce a chart for services recorded in 15 minute increments. These are the fields that I am using:
Recorded_Service.Starttime
Recorded_Service.EndTime
Service_Item.ServiceItemDescription
@hours (formula for the difference between the Start and End times)

I've tried to create a formula to group the Recorded_Services.Starttime into 15 minute increments and it worked, but I can't seem to be able to fit the endtime into this formula correctly here is the formula:

if (time(Recorded_Service.Starttime) = time(08,00,00) or time(Recorded_Service.Startime) < time(08,15,00) then &quot;8:00&quot;
else if (time(Recorded_Service.Starttime) = time(08,15,00) or Recorded_Services.Startime) < time(08,30,00) etc.......
(I did this all the way up to 1800 hours) I know this is long but this is the only way it would work.

I am try to get the service time to range from start to end over a specific time frame within the 15 minute increments.

Is there someone who can tell me an easier way to obtain this?

Thanks

CD
 
To get the report to show data that isn't already there, you need to link in a table with the 15 minute intervals.


Here is a formula that will round your times to 15 minute intervals.

numbervar hr;
numbervar min;
numbervar mn;
timevar tm:=time(Recorded_Service.Starttime);
min:=minute(time(Recorded_Service.Starttime));
hr:=hour(tm);
mn:=round(min/15)*15;
if mn=60 then (hr:=hr+1;
mn:=0);
time(hr,mn,0)

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top