Calculation with Time

matthewnsarah07

Registered User.
Local time
Yesterday, 22:26
Joined
Feb 19, 2008
Messages
192
Hi

Quick question. I have a form with field [Remaining] which contains the hh:mm:ss of time staff are owed in it.

I want to populate two other fields from this one on a form.

1) [RemainingShift] needs to be the hours remaining as full shifts which are 7hrs56mins long

2) [RemainingCost] needs to be the hours multiplied by £20 to get the cost

How can I get these to calculate successfully??

Thanks
 
Use the DateDiff() function to calculate the difference in times

Then you need to multiply the minutes by (£20/60) Cost per minute

David
 
You shouldnt store calculated values...

Important is to realize that...

Assuming your 7hr56mins is a date/time field you need to know how to make a decimal time.
To calculate the 7 hr 56 mn to decimals you need to know that time is a decimal value in itself, where it represents a part of a day.
i.e. 0.25 = 8 hours, 0.5 = 12 hours
This means taking the date/time field and multiplying by 24 will translate the time to a 'decimal' time.

7:56 * 24 = 7.93333333333
7.9333333 * 20 = 158.666666666
 

Users who are viewing this thread

Back
Top Bottom