×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Access 2010 displaying hours and minutes in a table for summing

Access 2010 displaying hours and minutes in a table for summing

Access 2010 displaying hours and minutes in a table for summing

(OP)
Hi everyone,

In an Access table, I want to be able to enter hours and minutes so I can sum them.  This is one way the entries could be entered:  1:30 (representing 1 hr/30 min), 1:45 (representing 1 hr/45 min), 2:45, 4:30, etc.

The total/sum could appear as:  10:30 (representing 10 hr/30 min)

I have tried to use the Date/Time data type with different formats but I'm unsuccessful so far.

Is this possible in a table?  Many thanks in advance.

Best,
Blue Horizon 2thumbsup
 

RE: Access 2010 displaying hours and minutes in a table for summing



hi,

Understand the distinction between TIME, (in the sense of a point in time, which would include a Date and Time) and DURATION which is the mathematical difference between two points of time or a representation of a passage of time; time being Date and Time.

BTW, Date/Time values are just NUMBERS in units to DAYS.  So when you calculate a Date/Time difference (DURATION), it is expressed in days and can be formatted as hours, minutes and days via the Format() function.  HOWEVER, if the DURATION represents more than ONE DAY, the Format function wants to show the duration as a DATE & TIME.  So you mght need to do something different.

So you are referring to several DURATIONS: D1 + D2 + D3 like this...

CODE

Format(D1 + D2 + D3, "hh:nn:ss")
 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Access 2010 displaying hours and minutes in a table for summing

Expounding on what skip said, the Date/Time data type is a day and time combined... SO if you use no day (implicitly use a 0 days) when you hit 24 hours you are in day two so Skips example will return unexpected results if you roll past 24 hours with the date/time data type.

You might be better off storing minutes or even seconds depending on your purpose and then writing your own function to format it correctly.  A couple tips here... the forward slash in access is integer division or gives you the integer result.  The mod (short for modula) operator gives you the remainder.

RE: Access 2010 displaying hours and minutes in a table for summing

(OP)
Thank you to both!  I'll try your suggestions and get back with results!  The info re forward slash and mod is very helpful.

Best,
Kathy

Best,
Blue Horizon 2thumbsup
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close