swtjen01
asked on
How can I format timespan in field express to show just HH:mm
I have a report that I have to derive the DutyHours from two datetime fields (startdate & end date). datediff(minute, min(s.arriveDateTime), max(s.departDateTime)) 'hours', I needed the total time to show in hour and minutes as 10.05 instead of 10.09 (decimal). I fixed this with convert(varchar(2), x.hours / 60) + ':' + convert(varchar(2), x.hours % 60).
Now my problem is...how do I get my total hours. I can't SUM a string. I tried to use the timespan.parse in my field expression and that works great except that I don't need the seconds to show. Does someone know how to format the timespan option to show just HH:ss?
Now my problem is...how do I get my total hours. I can't SUM a string. I tried to use the timespan.parse in my field expression and that works great except that I don't need the seconds to show. Does someone know how to format the timespan option to show just HH:ss?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nobody presures you to have only one variable.
Make TWO variables: one for formated user readbale output and the other as hidden variable only for internal sum calculation.