IIF within IIF

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I put a IIF within a IIF statement? I want it to set null to zero and I
want it to calculate overtime hours.

Thanks
 
The general syntax for a nested IIF statement is:

IIF(<Condition>, <If True>, IIF (<Condition>, <If True>, <If False>))
 
Better still try using this function:

nz([Number you want zero if null], 0)

The 2nd parameter in this function is the "if null" parameter ie what
would you like to put if the record is null.

NB I've found that sometimes access will switch these sorts of
expressions into string/text fields as opposed to numeric fields. The
following methodology should solve this issue:
nz([number you want zero if null], 0) + 0
 
IIF(ISNULL([HOURS]),0,IIF([HOURS]>38,((([HOURS]-38)*([PAYRATE]*2)) +
([PAYRATE] * 38)),([HOURS]*[PAYRATE])))

Keep an eye on the ")"s... IIF(,IIF(,,),IIF(,,))
 
Sarah Stockton said:
Can I put a IIF within a IIF statement? I want it to set null to zero and I
want it to calculate overtime hours.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multiple iif challenge 2
Aggregate Function Error 0
IIF statements 2
iif Expression Error 6
Limits of IIF? 1
IIF statement 5
IIf return multiple categories 6
Access My Expression Contains Wrong number of arguments 0

Back
Top