"if -- then" criteria in querys.

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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.
 
Back
Top