Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have answered some questions and have gotten answers for my questions. Anywhere you can do this on one page helps tremendously..."

Geography

Where in the world do Tek-Tips members come from?

Access 2010 displaying hours and minutes in a table for summing

BlueHorizon (Instructor)
2 May 12 14:07
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
 

SkipVought (Programmer)
2 May 12 14:20


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

lameid (Programmer)
2 May 12 17:01
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.
BlueHorizon (Instructor)
2 May 12 17:13
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
 

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!

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