Calculating time
Hello,
I got stuck with calculation/rounding and converting numbers back to time
Maybe I was taking too complicated way to do so ...
I am trying to do some small helper to count the time for each employee / timecards calculator
I have a following table (for each employee one)
F1 = IN/OUT F2 = date F3 = time
IN 1/4/2008 8:53
OUT 1/4/2008 17:21
IN 2/4/2008 8:42
OUT 2/4/2008 16:44
I need to round the time first. There are different rules to round the time for IN and different for OUT.
IN - ROUND function - i do not have any problems with that
OUT - FLOOR function from MS excel, factor = 15 minutes
FLOOR - I did query, I separated hours from minutes using DatePart function and I did a module to define FLOOR as Floor = Int(X / Factor) * Factor
and I rounded the separated minutes using FLOOR
In my case I got:
worked
hours minutes FLOOR
17 21 15
16 44 30
Now I need to get them back to hour format and I am having trouble to do so. I would like to see 17:15 or 16:30 in my case
|