Link to home
Start Free TrialLog in
Avatar of Marcus Aurelius
Marcus AureliusFlag for United States of America

asked on

Bad Date-Time Format

Experts:

I need help calculating AVERAGE TIME. I have a field that holds a CALL_DURATION of a telephone call in this format:

CALL_DURATION
---------------------
00:14
00:20
00:05
145:14
100:10
60:15

When I try to use this formula I get the error:   BAD DATE-TIME FORMAT STRING

//@CallDurationToSeconds
(
(hour(datetime({View_smdrdata_Phone_System.CallDuration})) * 60 * 60 ) +
(minute(datetime({View_smdrdata_Phone_System.CallDuration})) * 60)
+ (second(datetime({View_smdrdata_Phone_System.CallDuration})))
) /60


This is the portion that is CR highlights as being a problem:

datetime({View_smdrdata_Phone_System.CallDuration})

I've tried different things...but I can't seem to get it....your help is appreciated.

MikeV
ASKER CERTIFIED SOLUTION
Avatar of dsacker
dsacker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Of course, you may need to reverse the average back into the same format as the call duration. If your average ends up being only a value reflected in seconds, that could be done in the Display XSS with the following:

(CurrentFieldValue \ 60) & ":" & (CurrentFieldValue Mode 60)
Avatar of Marcus Aurelius

ASKER

Error...

A number or currency amount is required...

I'll keep adjusting the type and see if I can get it to work...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial