By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,306 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

How do I Sum Time Values

P: 13
The scenario is based on 2 data fields: "IN" and "OUT": both are time fields and the main function is to serve as a punch clock. In order to work out calculations and get the total time, both were passed into a query and set out the formula:

datediff ("n",[in],[out])

So to convert the raw time of the latter formula, i set a new one to divide the amount of 'datediff' into hours and minutes:

[totalhours]\60 & Format([totalhours] Mod 60, "\:00")

Everything's fine to here... however, when i loaded the query into a continuous form and set the SUM function into an unbound text box (so i could sum up all the totalhours) ERROR pops up. The control scorce of the textbox is:

=SUM([totalhours])\60 & Format(SUM([totalhours]) Mod 60, "\:00")

Obviously the textbox is set in the footer but still resolving the error.

What is the reason of the error?
Clara
Apr 10 '12 #1

✓ answered by Rabbit

The problem is that 3:45 is not a number. You can't add them up. What you need to do is sum up the minutes and do the conversion back into hours and minutes.

Share this Question
Share on Google+
3 Replies


Rabbit
Expert Mod 10K+
P: 12,315
The problem is that 3:45 is not a number. You can't add them up. What you need to do is sum up the minutes and do the conversion back into hours and minutes.
Apr 10 '12 #2

P: 13
Big thanks rabbit :) all i wanted was to be enlightened in this case! :)
Apr 10 '12 #3

Rabbit
Expert Mod 10K+
P: 12,315
Not a problem, good luck.
Apr 10 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.