What's happening is that it's totalling the numeric representation of the times
You can do this:
Select Personid, cdate(sum (TotalHours)) as GrandTotal
from table
group by personid.
But you are going to get results that look like:
111 1900-01-01 2:28:10 AM
222 1:23:32 AM
This because Personalid 111 exceeds 24 hours
What you really have to do is smoosh the times down to seconds; then add them; and then break it out into hours/minutes/seconds again; I did this with two queries
[time_1 definition]
SELECT time_tab.pid,
Sum(Hour([time]) * 3600
+ Minute([time]) * 60
+ Second([time])) AS time_total
FROM time_tab
GROUP BY time_tab.pid;
[time_2 definition]
SELECT time_1.pid,
Int([time_total]/3600) AS h,
Int(([time_total]-Int([time_total]/3600) * 3600)/60) AS m,
[time_total]
- (Int(([time_total]-Int([time_total]/3600) * 3600)/60)*60
+ (Int([time_total]/3600)*3600)) AS s
FROM time_1
which gives me
111 50 28 10
222 1 23 32
OR
[time_2 definition]
SELECT time_1.pid,
Int([time_total]/3600) & ":"
& Int(([time_total]-Int([time_total]/3600) * 3600)/60) & ":"
& [time_total]
- (Int(([time_total]-Int([time_total]/3600) * 3600)/60) * 60
+ (Int([time_total]/3600)*3600)) AS grand_total
FROM time_1
which gives me
111 50:28:10
222 1:23:32