Iff null?

M

Michelle

I have a report that has System Description....if a user is assigned to the
system then the FullName should show up however if the FullName is blank then
I want the LocationDescription to show up...can this be done if so how?
Thanks
Michelle
 
K

Keith Wilby

Michelle said:
I have a report that has System Description....if a user is assigned to the
system then the FullName should show up however if the FullName is blank
then
I want the LocationDescription to show up...can this be done if so how?
Thanks
Michelle

Calculate a field in the report's query:

System Description: Iif(IsNull([FullName]),[LocationDescription],[FullName])

HTH - Keith.
www.keithwilby.com
 
M

Marshall Barton

Michelle said:
I have a report that has System Description....if a user is assigned to the
system then the FullName should show up however if the FullName is blank then
I want the LocationDescription to show up...can this be done if so how?


Another way would be to use an expression in the report text
box:
=Nz(FullName, LocationDescription)
 
M

Michelle

I tried both ways and they both give me the same result....if the FullName is
blank then it give me a blank filed and does not give me the
LocationDescription, however if the FullName is not null then it gives me the
FullName.
What I want is....
System Description Full Name LocationDescription
Ann Smith Ann Smith UP-LUB
CON-LAB CON-LAB
Dave Smith Dave Smith CON

(the FullName and LocationDescription will not be on the report just the
System Description)

Thanks
Michelle
 
M

Marshall Barton

I think that means the FullName field in its table has its
AllowZeroLength property set to Yes. (Note that that is
rarely a good idea.)

If my suspicion is correct, then the field has a zero length
string instead of Null. Or maybe your user actually entered
one or more space characters in the name field.

You can guard against all those situations by using a
somewhat messy expression:

=IIf(Len(Trim(FullName & "")) > 0, FullName,
LocationDescription)
 

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