Expression Builder Question

A

AJ

I am using:
=IIf([Type]="ab","Store","Site")

My issue is that I have 3 possible values, ab,cd,"space".
If [type] = ab then "Store", if [type] = cd then "Site"
How can I get it to leave space alone. If the value is blank, I want to
leave it blank.
I tried to use an or statement but cannot seem to get it to work, any ideas?
Thanks.
 
D

DanRoss

You can chain them together. . .

=IIf( [type]="ab","Store", IIf( [type]="cd","Site", "") )
 
F

fredg

I am using:
=IIf([Type]="ab","Store","Site")

My issue is that I have 3 possible values, ab,cd,"space".
If [type] = ab then "Store", if [type] = cd then "Site"
How can I get it to leave space alone. If the value is blank, I want to
leave it blank.
I tried to use an or statement but cannot seem to get it to work, any ideas?
Thanks.

A space is not the same a blank.

=IIf([Type] = "ab","Store",IIf([Type] = "cd","Site","")

Note: Type is a field property and should NOT be used as a field name.
For a list of additional words that should not be used as field names
see:
http://www.allenbrowne.com/AppIssueBadWord.html
 
D

DanRoss

=IIf([Type] = "ab","Store",IIf([Type] = "cd","Site"," ") <-- simply add a
space between the two quotes -




fredg said:
I am using:
=IIf([Type]="ab","Store","Site")

My issue is that I have 3 possible values, ab,cd,"space".
If [type] = ab then "Store", if [type] = cd then "Site"
How can I get it to leave space alone. If the value is blank, I want to
leave it blank.
I tried to use an or statement but cannot seem to get it to work, any
ideas?
Thanks.

A space is not the same a blank.

=IIf([Type] = "ab","Store",IIf([Type] = "cd","Site","")

Note: Type is a field property and should NOT be used as a field name.
For a list of additional words that should not be used as field names
see:
http://www.allenbrowne.com/AppIssueBadWord.html
 

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