Simplify formula

CV79

New member
Local time
Today, 07:47
Joined
Sep 23, 2015
Messages
1
Hi,

I am working with access 2007, on a formula to calculate worked hours. It covers day and night shifts and I have manage to come up with the following

Billable_Hours: Format((DateDiff("s",[Time_In],[Time_Out]-DateDiff("d",[Startshift_Date],[Time_Out]))/60/60/24),"h:nn")

(Note that some employees start i.e. today at 21pm and finish at 4am tomorrow)

However when i try to multiply the hours from the calculated field above by the hourly rate (i.e. calculate Billable_Hours by Emp_Hourly_Rate) it does not work. It says something like is too complex i should try to simplify it.

Unfortunately this is the best i can do. There is no way i can simplify it and get the same result as the calculation above.

Can anyone help me please?

I look forward to hearing from you.

Many thanks
CV79
 
normally you just do

datediff("h",[startdate],[endDate])
 
you are taking the number of seconds, minus the number of days (e.g. 2321-1). Not very useful. Use Ranman's formula or at least get rid of -DateDiff("d",[Startshift_Date],[Time_Out])) from your formula
 
FYI, thread moved out of introductions forum.
 

Users who are viewing this thread

Back
Top Bottom