convert a duration stored as HH:MM to total minutes.

Goosie1
Goosie1 used Ask the Experts™
on
Hello,

I need a Crystal reports formula to convert a duration stored as HH:MM to total minutes. For example, 02:00 would convert to 120.

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
IS it stored as  time or a string?

If it is a string then use a formula

Local StringVar myTime := {YourTimeField};
Val(Split(myTime, ':')[1]) * 60 + Val(Split(myTime, ':')[2])

mlmcc
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
If it is a time then use a formula

Local TimeVar myTime := Time(02,04,00);
DateDiff('n',DateTime(1900,1,1,0,0,0),DateTime(Date(1900,1,1),myTime));

mlmcc

Author

Commented:
It is a string, and that worked. Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial