"if -- then" criteria in querys.

G

Guest

I have a data base that contains family information (address, phone, family last name) and then is related to individuals of that family (first name, last name if differnt from family name, birthdate, etc.) information. The individual members are linked by their "family last name", but some members of certain families have a different "last name". I want to run a query that would ask -- and I don't know how to type it correctly -- If "last name" field is blank, then insert the "family last name". I need to be able run individual mailing labels with the correct last name.

I am using Access 2002. thanks!
 
M

Mike

If you do this in an unbound text box in your report you
don't need to mess with your query as long as you have all
the fields in the query.

iif(IsNull([Last Name]),[Family Last Name],[Last Name])

Mike

-----Original Message-----
I have a data base that contains family information
(address, phone, family last name) and then is related to
individuals of that family (first name, last name if
differnt from family name, birthdate, etc.) information.
The individual members are linked by their "family last
name", but some members of certain families have a
different "last name". I want to run a query that would
ask -- and I don't know how to type it correctly --
If "last name" field is blank, then insert the "family
last name". I need to be able run individual mailing
labels with the correct last name.
 

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