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!

Calculate Time difference between two job - Impromptu 1

Status
Not open for further replies.

jabedin

Programmer
Feb 24, 2004
37
AU
Hi All,

I have a table with the data like this
Person Start End
A 10:30 12:30
A 13:40 15:30
A 15:50 18:30
B 07:00 09:30
B 10:40 12:40

I want to calculate the time difference next start(ie for A I want to calculate time between 12:30 to 13:40 which will be available in next 2nd record). Any help regarding this will be highly appreciated.

Regards

Jay
 
I've done this sort of thing for dates but it's not that easy to explain how I did it. OK Here goes.
Create a calculated column RankStart1:
Rank_Start1(Start1) for ID1
Save this report as say, Report1
Now create an identical report but use 2 as the name suffix for the data items(Person2, Start2 etc.)
Now go back to the Query data tab and open Report1 as a hotfile and select all the data items in report1.
Now create a Detail filter
ID=ID2
AND a Summary filter:
RankStart2=RankStart1+1
The report will now have the appropriate start dates in the same rows so you can do the subtraction
Simon Rouse


 
Thank you very much DrSimon.

If I could understand you correctly, I will create report REPORT1 from TABLE1 with the calculated column. save the report as REPORT1. Now will create another report REPPORT2
where first I will get the original data from TABLE1 with different name suffix then open the REPORT1 as HOTFILE.

I will try and GET BACK TO YOU.

Regards

Jay
 
It seems like you've understood it. Of course you could reopen Report1 and save it as Report2 to make it quicker. When using hotfiles like this, I usually rename the column items as the defaults are confusing.
Simon Rouse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top