Solved IIF Statement not working... (1 Viewer)

hbrehmer

Member
Local time
Today, 00:05
Joined
Jan 10, 2020
Messages
78
I have a report that I want data to display very specifically. I want my part name and revision level to show on the report, but if the revision level is blank, to display only the part name. This is what I have in an unbound text field on the report:

=[PartName] & IIf([RevLevel]=" "," "," Rev " & [RevLevel])

What I get is: Part Name Rev NOT just Part Name when the RevLevel is blank. Am I missing something? I don't want the word "Rev" to appear when the field [RevLevel] is blank.

Any advise would be helpful and appreciated.

Heidi
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:05
Joined
Aug 30, 2003
Messages
36,118
Try

IIf(Nz([RevLevel],"")="",""," Rev " & [RevLevel])
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:05
Joined
Oct 29, 2018
Messages
21,358
Hi Heidi. Try it this way:
Code:
=[PartName] & ("Rev " + [RevLevel])
Hope that helps...
 

Users who are viewing this thread

Top Bottom