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.
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
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
Skip,
Just traded in my old subtlety...
for a NUANCE!
RE: Access 2010 displaying hours and minutes in a table for summing
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
Best,
Kathy
Best,![[2thumbsup] 2thumbsup](https://www.tipmaster.com/images/2thumbsup.gif)
Blue Horizon