access query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that pulls name/address information. There is an adrcode
field that shows if the address is work or home and there is a company field.
I only want to pull the company field if the adrcode field = work. How can
I do this?
 
Did not follow all you said. Do you have two addresses or one that can be
either home or work?
 
Leslie said:
I have a query that pulls name/address information. There is an adrcode
field that shows if the address is work or home and there is a company field.
I only want to pull the company field if the adrcode field = work. How can
I do this?


Use a calculated field something like:

ContactAddr: IIf(adrcode = "work", homeaddress, workaddress)
 
One address that is either work or home with the indicator being the adrcode
field.
 
My best guess at what you want is that you are only interested in the company
name. So if the address is home then ignore.
In the design view of your query add an output field to the grid like this --
Company Name: IIF([adrcode] = "work", [company],"")
or
Company Name: IIF([adrcode] = "work", [company],"Home address only")
 

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

Back
Top