Multiply time my quantity

Infinite

More left to learn.
Local time
Today, 04:13
Joined
Mar 16, 2015
Messages
402
I have the time per item, and I would like to multiply that by the quantity, so I can tell the total time. But I cant find in access how to * data/time by a number.
 
I believe the issue you are having is you are trying to multiply at different levels (secound, minute, hour) at the same time and that doesn't work. You need to convert your time to a base unit and do the math there.

3*(3 hours, 5 minutes, 24 seconds) = 3*(185 minutes, 24 seconds) = 3*(11124 seconds) = 33372 seconds
 
Well, that is a answer I was looking for. Ish. Its going to be annoying having to A( Do it manually or B( create 2 tables to times them to minutes, and then to seconds. But, you did answer the question, so thank you much!
 
If you are using a time datatype then the time is actually stored in days. So 06:00:00 (6hours) is stored as 0.25 i.e. 0.25 of a day. So you can easily add and multiply times to your hearts content. But the answer will be in days.

If your result is always less than 1 day e.g. 9 hours x 2, then you can easily display the result by formatting e.g. hh:mm. Result of 09:00:00 x 2 = 18:00:00. All the calculation is done in days so youdon't need to worry about dealing with hours, minutes, seconds etc.

If your result is > one day then you will need to do some work to format the hours and minutes because time alone only sees 24 hours so 9hrs x 3 is greater than 24 hours and will be stored as 1.123 (days). But formatting this as hh:mm will show as 03:00 which is 27:00 in the 24 hour clock.

hth
Chris
 

Users who are viewing this thread

Back
Top Bottom