Nested IIf

A

Angelita Guevara

I have this expression which works well in generating Committee Member
tenure/histories:

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

That said; however, I now need to add the following condition. Any ideas how
best to incorporate the below in its simplest form please...before my brain
starts to fry? Too many conditions, so little time...

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

If it helps, here's the detailed syntax:

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

Many thanks,
a
 
O

Ofer Cohen

Try

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

Angelita Guevara

Thanks for this Ofer. It works wonderfully! You are awesome!

God bless,
a

Ofer Cohen said:
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 have this expression which works well in generating Committee Member
tenure/histories:

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

That said; however, I now need to add the following condition. Any ideas how
best to incorporate the below in its simplest form please...before my brain
starts to fry? Too many conditions, so little time...

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

If it helps, here's the detailed syntax:

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

Many thanks,
a
 

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