Int([TimeOut]-[TimeIn]) & " day "

piet123

piet
Local time
Today, 06:52
Joined
May 24, 2004
Messages
66
Hello, (not sure if this post belongs in the Reports forum, sorry)

From 2 Tables: In the Query I have these fields:

LogID | UserID | TimeIn | TimeOut |

with an additional column where I have this:

TotalTime: Int([TimeOut]-[TimeIn]) & " day " & Format([Timeout]-[TimeIn],"h"" hr ""n"" min ""s"" sec""")

The above gives me the total time "TimeIn" to "TimeOut". For example:

Record1: 1 day 2 hours 33 minutes 44 seconds.
Record2: 2 days 3 hours 4 minutes 6 second.

No Problems there.

In a Report based on this query, I can show each record and GROUP IT BY >USERID<

I need help with the following :

In the Group Footer for UserID, I need to SUM the column (TotalTime) from the above Query. So that the SUM of the above 2 records shows:

Total All Records: 3 days 5 hours 37 minutes 50 seconds.

Any advice please.

Thank You.
 
Simple Software Solutions

Hi

You will need to create a functions that performs elapsed times between dates and times and convert them into a format that is seconds past midnight then convert it back to real time.

So for example you first need to calc the datediff in whole days, then multiply that by 86400 (Seconds in a day)

Work out the elapsed time between log on time and the next midnight in secs
Work out the elapsed time between midnight to log off time in secs

add all three together

Then divide down to work out the actual elapsed time.

then at the group level of your report call the function in a calulculated field.

Code master::cool:
 
Total Time

I think I got it sorted in the meantime...

I tried this in the Group Footer and it works:

=Int(Sum([TimeOut]-[TimeIn])) & " day " & Format(Sum([Timeout]-[TimeIn]),"h"" hr ""n"" min ""s"" sec""")

Thanks anyway.
 

Users who are viewing this thread

Back
Top Bottom