View Full Version : 7days of seconds into hh:nn:ss


mkheys
03-01-2010, 12:35 PM
Hi All

I am trying to convert a sum of secondd from my telephony platform for 7 days. I have succesfully changed 1 days data into hh:nn:ss using
Format(((sum([field]))/86400),"hh:nn:ss"), and then tried to use, Format(((Sum([ti_stafftime]))/604800),"hh:nn:ss") to change the 7 days of information

EG total hours for the week 114613 = 31:50:08

ajetrumpet
03-01-2010, 02:03 PM
Hi All

I am trying to convert a sum of secondd from my telephony platform for 7 days. I have succesfully changed 1 days data into hh:nn:ss using
Format(((sum([field]))/86400),"hh:nn:ss"), and then tried to use, Format(((Sum([ti_stafftime]))/604800),"hh:nn:ss") to change the 7 days of information

EG total hours for the week 114613 = 31:50:08


this is complicated, but not so much to me. here is the math solution that you could use:SELECT ROUND([FIELD]/60/60, 2) AS [GROSS HOURS],

ROUND(RIGHT([GROSS HOURS], 2) * 60, 2) AS [GROSS MINUTES],

ROUND(RIGHT([GROSS MINUTES], 2) * 60, 2) AS [GROSS SECONDS],

ROUND([GROSS HOURS], 0) & ":" &

ROUND([GROSS MINUTES], 0) & ":" &

ROUND([GROSS SECONDS], 0) AS [TOTAL HOURS FOR THE WEEK]the first 3 fields are just there to show you how to get to the end result. if using this in a query, do not SHOW these columns, but only the last one, which is the output you apparently want here.

raskew
03-02-2010, 06:03 AM
Hi -

Give this a try:

x = 114613
? Format(x \ 3600, "00") & ":" & Format((x Mod 3600) \ 60, "00") & ":" & Format(x Mod 60, "00")
31:50:13

HTH - Bob