A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

access query



 
 
Thread Tools Display Modes
  #1  
Old October 26th, 2006, 08:06 PM posted to microsoft.public.access.queries
Leslie
external usenet poster
 
Posts: 259
Default access query

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?
--
Leslie - AGA
  #2  
Old October 26th, 2006, 08:53 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default access query

Did not follow all you said. Do you have two addresses or one that can be
either home or work?


"Leslie" wrote:

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?
--
Leslie - AGA

  #3  
Old October 26th, 2006, 09:11 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default access query

Leslie wrote:

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)

--
Marsh
MVP [MS Access]
  #4  
Old October 27th, 2006, 01:08 AM posted to microsoft.public.access.queries
Leslie
external usenet poster
 
Posts: 259
Default access query

One address that is either work or home with the indicator being the adrcode
field.
--
Leslie - AGA


"KARL DEWEY" wrote:

Did not follow all you said. Do you have two addresses or one that can be
either home or work?


"Leslie" wrote:

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?
--
Leslie - AGA

  #5  
Old October 27th, 2006, 05:10 AM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default access query

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")

"Leslie" wrote:

One address that is either work or home with the indicator being the adrcode
field.
--
Leslie - AGA


"KARL DEWEY" wrote:

Did not follow all you said. Do you have two addresses or one that can be
either home or work?


"Leslie" wrote:

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?
--
Leslie - AGA

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.