Nz

A

Annie

Hi.
I am using
Member Name: Nz([NickName],[FirstName])
so that if a member has a NickName, I'm using it on a
mailing label rather than the FirstName.

However I have Companies that have contacts with
ContactNickName and ContactFirstName.

If there is a NickName, there is not a ContactNickName.

I want one mailing label: if there is a "member" I want
the NickName else the FirstName. If there is a "contact"
I want the ContactNickName else the ContactFirstName.

I tried to build one big Nz statement but it didn't work.
Any suggestions?

Thanks, Annie
 
J

JP

You have to do it with an iif statement that has some NZs embedded in it.

for example (may not be perfect):

Name: iif(nz(nickname,"") <> "" or nz(firstname, "") <> "", nz(nickname,
firstname), nz(contactnickname, contactfirstname))

If there is a nickname or a firstname, then select from the nickname and
firstname, otherwise, select from the contactname and contactfirstname
This does assume that there is at least one name in there for each person
(nickname or firstname or contactnickname or contactfirstname)
 
A

Annie

Thanks- I'll give it a try!
-----Original Message-----
You have to do it with an iif statement that has some NZs embedded in it.

for example (may not be perfect):

Name: iif(nz(nickname,"") <> "" or nz(firstname, "")
firstname), nz(contactnickname, contactfirstname))

If there is a nickname or a firstname, then select from the nickname and
firstname, otherwise, select from the contactname and contactfirstname
This does assume that there is at least one name in there for each person
(nickname or firstname or contactnickname or contactfirstname)


Hi.
I am using
Member Name: Nz([NickName],[FirstName])
so that if a member has a NickName, I'm using it on a
mailing label rather than the FirstName.

However I have Companies that have contacts with
ContactNickName and ContactFirstName.

If there is a NickName, there is not a ContactNickName.

I want one mailing label: if there is a "member" I want
the NickName else the FirstName. If there is a "contact"
I want the ContactNickName else the ContactFirstName.

I tried to build one big Nz statement but it didn't work.
Any suggestions?

Thanks, Annie


.
 

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

Similar Threads

nz 5
sql union self-join syntax 27
default value 2
IIf 18
Query not limited as expected 4
IIF in select 4
Oh, Canada! Mailing address issues. 10
Union query- count records 2

Top