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

convert datediff minutes field to hh:mm

Status
Not open for further replies.

spl1

Vendor
Nov 5, 2009
3
GB
Hi
I have two dd/mm/yyyy hh:mm:ss fields which I have used a formula of:-
time({VP_TIMESHTPUNCHV42.OUTPUNCHDTM}-{VP_TIMESHTPUNCHV42.INPUNCHDTM})
which gives me the answer as hh:mm:ss on each Detail line within the group.
I have then used:-
datediff("n", {VP_TIMESHTPUNCHV42.INPUNCHDTM},{VP_TIMESHTPUNCHV42.OUTPUNCHDTM})
which gives me the answer in minutes which i thought would be the easiest way to then add the minutes from each detail line for the group and then the whole report. But this is not the case
The next issue is the group is classed on event date ie 1 date, but then on the group expert I have asked for the section to be printed for each week - so if i try and use a sum(minutes field , group) - crystal does not recognise the group....
Any idea's how I can sum the minutes and then convert back to hh:mm
Many thanks in advance
Sarah
 
You should be able to simply right click on the datediff formula in the detail section and insert a sum on it at the group level. To write a formula for it, you would have to specify the interval as the third argument in the summary:

sum({@datediff},{table.eventdate},"weekly")

Then use faq767-3543 to convert to the string, setting the formula above = dur.

-LB
 
Thank you, I now have the answer I need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top