Solved Sum Total Hours Over 24 (1 Viewer)

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 07:27
Joined
Feb 5, 2019
Messages
293
Hi all,

Does anyone know of a way to mimic the Excel [h]:mm:ss in an Access query?

This is for our capacity planner to show how much time has been allocated to a job.

I have the below from Access, and in Excel it sums to a total of 80:58:20 if I format as [h]:mm:ss, but I cannot get access to display this the same in Access.

Access displays the below as 00:58:20 ( I am using "hh:nn:ss")

QtyGroupLabour
300Production00:00:30
2:30:00​
100Production00:02:50
4:43:20​
200Production00:00:12
0:40:00​
800Production00:00:06
1:20:00​
650Production00:01:30
16:15:00​
1300Production00:00:06
2:10:00​
50Production00:00:00
0:00:00​
50Production00:00:00
0:00:00​
400Production00:00:06
0:40:00​
1800Production00:00:12
6:00:00​
1650Production00:00:30
13:45:00​
150Production00:04:00
10:00:00​
3450Production00:00:12
11:30:00​
50Production00:01:00
0:50:00​
50Production00:01:30
1:15:00​
3600Production00:00:06
6:00:00​
400Production00:00:30
3:20:00​
80:58:20​


~Matt
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:27
Joined
Oct 29, 2018
Messages
21,473
You may have to use a custom function in Access to do the same.
 

mike60smart

Registered User.
Local time
Today, 07:27
Joined
Aug 6, 2017
Messages
1,905
Hi all,

Does anyone know of a way to mimic the Excel [h]:mm:ss in an Access query?

This is for our capacity planner to show how much time has been allocated to a job.

I have the below from Access, and in Excel it sums to a total of 80:58:20 if I format as [h]:mm:ss, but I cannot get access to display this the same in Access.

Access displays the below as 00:58:20 ( I am using "hh:nn:ss")

QtyGroupLabour
300Production00:00:30
2:30:00​
100Production00:02:50
4:43:20​
200Production00:00:12
0:40:00​
800Production00:00:06
1:20:00​
650Production00:01:30
16:15:00​
1300Production00:00:06
2:10:00​
50Production00:00:00
0:00:00​
50Production00:00:00
0:00:00​
400Production00:00:06
0:40:00​
1800Production00:00:12
6:00:00​
1650Production00:00:30
13:45:00​
150Production00:04:00
10:00:00​
3450Production00:00:12
11:30:00​
50Production00:01:00
0:50:00​
50Production00:01:30
1:15:00​
3600Production00:00:06
6:00:00​
400Production00:00:30
3:20:00​
80:58:20​


~Matt
Hi Matt
What does the Value 300 equate to for Qty
and 00:00:30 for Labour ?
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 07:27
Joined
Feb 5, 2019
Messages
293
Hi Matt
What does the Value 300 equate to for Qty
and 00:00:30 for Labour ?
Hi Mike,

This would be 30 seconds per operation, 300 operations for 150 minutes which makes 2 hours 30 minutes 0 seconds. Anything that is under 24 works perfectly.

~Matt
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:27
Joined
Feb 28, 2001
Messages
27,186
Just to clarify...

You actually CAN add times in a date variable and the amount of time WILL be correct. Dates would (presumably) be correct through 31-Dec-9999 as long as we don't have another event like the conversion from Julian to Gregorian time. (That's the event that moved the date of New Year's Day away from the Winter Solstice.)

The problem is formatting. Access date/time formatting functions do not have the ability to format more than 23 hours in an hh:nn:ss format. What they do instead is convert things to dates and times if more than one day total time is indicated. However, addition of elapsed times in a Date variable is still valid from a numeric and functional viewpoint.

As noted by Josef P., the solution is to "roll your own" date formatting routine.
 

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 07:27
Joined
Feb 5, 2019
Messages
293
I though it was meant to be 80:58:20 ?
Hi Gasman,

There was another column I didn't show. There is also a setup time for each operation which is a fixed time over the job no matter the quantity.

If an operation takes an hour to setup, this is shared over the qty of the build, not the operations qty. Not every operation has a setup, in this case there is only 1 hour between all the operations. I knew if the ops timings worked, the setup would too, so I didn't show that part.

~Matt
 

Users who are viewing this thread

Top Bottom