CrystalMethod
Programmer
Hello all,
I am currently attempting to calculate the time difference( measured in Days,Hours,Minutes) between Scheduled and Actual delivery times. I first made this formula to return the difference:
//{@DelvTimeDeviance}=
// (CDateTime (CDate ({Loads.DelvDate}),CTime ({Loads.delvTime}))-
// CDateTime (CDate ({Loads.SchedDelv}),CTime({Loads.schedDelvTime}))) * 1440 ;
And then this formula to display in DD,HH,MM format:
Cstr(int({@DelvTimeDeviance}/1440),0)&":"&
cstr(int(({@DelvTimeDeviance}mod 1440) /60),0)&":"&
Cstr((((({@DelvTimeDeviance}mod 1440) /60) ) -
int(({@DelvTimeDeviance}mod 1440) /60) ) *60,0);
There is an issue however, if the delivery is made early returning a negative value. Not insurmountable, but before I start with all the math I am wondering if there a function in Crystal to display a Date/Time result in a DD,HH,MM format..? I appreciate your help!
I am currently attempting to calculate the time difference( measured in Days,Hours,Minutes) between Scheduled and Actual delivery times. I first made this formula to return the difference:
//{@DelvTimeDeviance}=
// (CDateTime (CDate ({Loads.DelvDate}),CTime ({Loads.delvTime}))-
// CDateTime (CDate ({Loads.SchedDelv}),CTime({Loads.schedDelvTime}))) * 1440 ;
And then this formula to display in DD,HH,MM format:
Cstr(int({@DelvTimeDeviance}/1440),0)&":"&
cstr(int(({@DelvTimeDeviance}mod 1440) /60),0)&":"&
Cstr((((({@DelvTimeDeviance}mod 1440) /60) ) -
int(({@DelvTimeDeviance}mod 1440) /60) ) *60,0);
There is an issue however, if the delivery is made early returning a negative value. Not insurmountable, but before I start with all the math I am wondering if there a function in Crystal to display a Date/Time result in a DD,HH,MM format..? I appreciate your help!