IIF function nor work good

  • Thread starter Thread starter hermie
  • Start date Start date
H

hermie

=IIf(IsNull([porhora]),[mensual],IIf(IsNull([salario_otro]),[porhora],[salar
io_otro]))

If have the next IIF formula in my report

=IIf(IsNull([porhora]),[mensual],IIf(IsNull([salario_otro]),[porhora],[salar
io_otro]))

This formula works, it shows the fields porhora and mensual but not the
field salario_otro?

What is wrong in the formula that it not shows the field salario_otro?
How should the formula look like?
Finally the result should be:

Herman $5.15
Ivan $6.00
Ivette
Bill $ 1155.00
Isaac Commission

Hermie
 
Your expression gives you the following 3 possible outcomes:

1. [porhora] is null. The field gets the value of [mensual].
2. [porhora] is not null, but [salario_otro] is. The field gets the
value of [porhora].
3. [porhora] is not null, and neither is [salario_otro]. The field gets
the value of [salario_otro].

So if you're only seeing the values of [porhora] and [mensual] in your
report, you must have no case where [salario_otro] is null. Check your
table for the values stored in [salario_otro]. Remember that a value of
0 is not the same as null.

grep
 
Tnx Grep with your info i got it working

Formula is now:
=IIf(IsNull([porhora] Or
[salario_otro]),[mensual],IIf(IsNull([salario_otro]),[porhora],[salario_otro
]))

grep said:
Your expression gives you the following 3 possible outcomes:

1. [porhora] is null. The field gets the value of [mensual].
2. [porhora] is not null, but [salario_otro] is. The field gets the
value of [porhora].
3. [porhora] is not null, and neither is [salario_otro]. The field gets
the value of [salario_otro].

So if you're only seeing the values of [porhora] and [mensual] in your
report, you must have no case where [salario_otro] is null. Check your
table for the values stored in [salario_otro]. Remember that a value of
0 is not the same as null.

grep
=IIf(IsNull([porhora]),[mensual],IIf(IsNull([salario_otro]),[porhora],[salar
io_otro]))

If have the next IIF formula in my report

=IIf(IsNull([porhora]),[mensual],IIf(IsNull([salario_otro]),[porhora],[salar
io_otro]))

This formula works, it shows the fields porhora and mensual but not the
field salario_otro?

What is wrong in the formula that it not shows the field salario_otro?
How should the formula look like?
Finally the result should be:

Herman $5.15
Ivan $6.00
Ivette
Bill $ 1155.00
Isaac Commission

Hermie
 
Back
Top