Multiple IIf statements

G

Guest

I've got the following expression which works quite nicely;

=IIf([EXPR4]=2222,[Description] & ", " & [TITLE] & "," & Left([EXPR2],5) & "
- " & "present",[Description] & ", " & [TITLE] & "," & Left([EXPR2],5) & " -"
& [EXPR4])

However, the time is ripe to add another conditional statement; hence, more
IIF as follows:

=IIf([EXPR3]=[EXPR2]), [Description] & "," & [TITLE] & "," & LEFT
([EXPR2],5), [DESCRIPTION] & "," & [TITLE] & "," & LEFT ([EXPR2],5) & "-" &
[EXPR4])

Any ideas how BEST to fit this new condition within the original IIF
statement above?

If it helps, please refer to the following syntax:

[EXPR2] = RIGHT ([EFFECTIVE_DATE],13)
[EXPR3] = RIGHT ([THRU_DATE],13)
[EXPR4] = LEFT ([EXPR3],5)

Please and...

Thanks,
angelita
 
G

Guest

If I understand you correctly try

=IIf([EXPR4]=2222 Or [EXPR3]=[EXPR2],[Description] & ", " & [TITLE] & "," &
Left([EXPR2],5) & " - " & "present",[Description] & ", " & [TITLE] & "," &
Left([EXPR2],5) & " -" & [EXPR4])
 
G

Guest

I just noticed the different from youe post in the Report section, try

=IIf([EXPR4]=2222,[Description] & ", " & [TITLE] & "," & Left([EXPR2],5) & "
- " & "present",IIf([EXPR3]=[EXPR2], [Description] & "," & [TITLE] & "," &
LEFT
([EXPR2],5), [DESCRIPTION] & "," & [TITLE] & "," & LEFT([EXPR2],5) & "-" &
[EXPR4]))
 
G

Guest

this one works perfectly. thanks again Ofer!


Ofer Cohen said:
I just noticed the different from youe post in the Report section, try

=IIf([EXPR4]=2222,[Description] & ", " & [TITLE] & "," & Left([EXPR2],5) & "
- " & "present",IIf([EXPR3]=[EXPR2], [Description] & "," & [TITLE] & "," &
LEFT
([EXPR2],5), [DESCRIPTION] & "," & [TITLE] & "," & LEFT([EXPR2],5) & "-" &
[EXPR4]))


--
Good Luck
BS"D


Angelita Guevara said:
I've got the following expression which works quite nicely;

=IIf([EXPR4]=2222,[Description] & ", " & [TITLE] & "," & Left([EXPR2],5) & "
- " & "present",[Description] & ", " & [TITLE] & "," & Left([EXPR2],5) & " -"
& [EXPR4])

However, the time is ripe to add another conditional statement; hence, more
IIF as follows:

=IIf([EXPR3]=[EXPR2]), [Description] & "," & [TITLE] & "," & LEFT
([EXPR2],5), [DESCRIPTION] & "," & [TITLE] & "," & LEFT ([EXPR2],5) & "-" &
[EXPR4])

Any ideas how BEST to fit this new condition within the original IIF
statement above?

If it helps, please refer to the following syntax:

[EXPR2] = RIGHT ([EFFECTIVE_DATE],13)
[EXPR3] = RIGHT ([THRU_DATE],13)
[EXPR4] = LEFT ([EXPR3],5)

Please and...

Thanks,
angelita
 

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

Top