I am trying to use a nested if statment using 2 parameters. But it does not seem to do the nested if statement

If ( Total Overtime Hours = "Yes" ; 0 ; If ( LUNCH = "Yes" ; Mod (Tiem out - Tiem in + 86400 - 1600; 86400) ; Mod (Tiem out - Tiem in + 86400; 86400) ) )

I have the following fields

total hours (this is where the code is calculated)

Total Overtime hours

Lunch

Overtime Results

Time in (I know I can't Spell)

Time out

would like this calculation to result in the total hours =

0 if Total Overtime Hours is "Yes"

total time - 30 min if total overtime hours is blank and Lunch = "Yes"

total time if total overtime hours is blank and lung is black.

The OTR is Yes I get a 0 but nothing after that. If I do just the nested if statement it works switching the Lunch from Yes to blank.

Any suggestions

Morning.

I would use a case statement. Cases are, in my opinion, easier to read. The FM calc engine runs through the list until it finds the first one that is true and then stops. It returns the result of the true line (the 2nd parameter in each line).

Case(

Total Overtime Hours = "Yes" ; 0;

LUNCH = "Yes" and IsEmpty (Total Overtime Hours ) ; Mod (Tiem out - Tiem in + 86400 - 1600; 86400) ;

IsEmpty ( Total Overtime Hours ) AND IsEmpty (LUNCH) ; Mod (Tiem out - Tiem in + 86400; 86400)

)

I took these directly from your calc result desire, described below.

The case statement is more descriptive to view.

I'm not quite sure what this means here. the IF statement would stop calculating if Total OverTimeHours = 0.