Calculate a Calculation

natural

Registered User.
Local time
Today, 21:27
Joined
Sep 4, 2006
Messages
57
Good morning

I am hoping someone can possible assist

I am currently trying to calculate the total of workinghours per week and struggeling to make ends meet. If a person does not work one day my calculation just comes back with nothing instead of a totals wich has been worked

I currently have the following

Monday threw to Sunday field these are formated to hours so any entry would result in 08:00 (Start) 17:00 (finish)

MondayStart - MondayFinsih - LunchHour = totalHours work for the day.
my calculation for the above mentioned workpatern is

MT: DateDiff("n",[WPMons],[WPMonf])/60-([WPLunch])

This calculation will give me the total hours worked per day, as a number
so
08:30 - 17:00 -1:00 = 7.5 Hours a day

I have done the above calculation for

MT (Monday total
TT (Tuesday Total)
WT (Wednesday total etc etc etc. and it works perfectly however

at the end I did the following to calculate the total hours worked per week

TotalWrkHours: ([MT]+[TT]+[WT]+[THT]+[FT]+[SAT]+[SUT])

but dont get anything if the person does not work on a sat and sun.

is there a way i can get the above to work if the is no values in some of the fields

Thank you very much in advance
 
a possible solution would be to use the NZ Function i.e. NZ(MT, 0)+ NZ(TT, 0) etc
 
Maybe you can just wrap your [SAT], etc in a nz() function?

(nz([MT])+nz([TT])+nz([WT])+nz([THT])+nz([FT])+nz([SAT])+nz([SUT]))

???
 
Brilliant.. It is working..

Thank you both very much for the help...
 

Users who are viewing this thread

Back
Top Bottom