Hello,
I have a SQL table that stores time as Time(0). I have a report that list all the employees hours for each day during the week as HH:MM. i need to find a way to total that time for the week so that for example 8:00+8:00+9:15 = 25:15.
I have tried to add a field in the report and take the TimeValue([Hours]) to get a double so that i can add the time up to 25.25. My issues comes when trying to convert that back to HH:MM so the end user doesn't see decimal time.
I am currently using:
int([hours]) & ":" & int(([hours]-int([hours]))*60)
Which works well except when i have a decimal like 10.03 which should convert to 10:02 but is coming out 10:2.
I am sure i am making this more complicated than it needs to be. My follow up question is should i have stored these hours as time in SQL or something else?
Thanks
I have a SQL table that stores time as Time(0). I have a report that list all the employees hours for each day during the week as HH:MM. i need to find a way to total that time for the week so that for example 8:00+8:00+9:15 = 25:15.
I have tried to add a field in the report and take the TimeValue([Hours]) to get a double so that i can add the time up to 25.25. My issues comes when trying to convert that back to HH:MM so the end user doesn't see decimal time.
I am currently using:
int([hours]) & ":" & int(([hours]-int([hours]))*60)
Which works well except when i have a decimal like 10.03 which should convert to 10:02 but is coming out 10:2.
I am sure i am making this more complicated than it needs to be. My follow up question is should i have stored these hours as time in SQL or something else?
Thanks