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  

Query criteria based on table entries



 
 
Thread Tools Display Modes
  #1  
Old April 22nd, 2010, 09:42 PM posted to microsoft.public.access.queries
Robbro
external usenet poster
 
Posts: 82
Default Query criteria based on table entries

I have a report based on a query to report our "10 worst" customers based on
a couple of factors. Certain customers however are just buying our off
quality products at cheap prices, and should not be included in our "10
worst" analysis.

I have added "Not In ("custname1","custname2" and so on) to my query
criteria line and that works fine, but for future ease of upkeep I thought I
would make a table of customers to not include in the "10 worst" query and
reference that, however I cannot get it to work so far. How do I reference
the table in my "Not In ( )" criteria area or can that even be done?

  #2  
Old April 22nd, 2010, 10:14 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query criteria based on table entries

Do not use the 'Not In'. In design view add the table that list the
Customers to omit. The table needs to have two fields, the second to flag
without having to add and remove as things change and include ALL customers.

Join on the CustomerID. Add the flag field in the Field row of the grid. In
the criteria row use value to allow query to pull those records you want.

--
Build a little, test a little.


"Robbro" wrote:

I have a report based on a query to report our "10 worst" customers based on
a couple of factors. Certain customers however are just buying our off
quality products at cheap prices, and should not be included in our "10
worst" analysis.

I have added "Not In ("custname1","custname2" and so on) to my query
criteria line and that works fine, but for future ease of upkeep I thought I
would make a table of customers to not include in the "10 worst" query and
reference that, however I cannot get it to work so far. How do I reference
the table in my "Not In ( )" criteria area or can that even be done?

  #3  
Old April 22nd, 2010, 10:17 PM posted to microsoft.public.access.queries
PieterLinden via AccessMonster.com
external usenet poster
 
Posts: 307
Default Query criteria based on table entries

Robbro wrote:
I have a report based on a query to report our "10 worst" customers based on
a couple of factors. Certain customers however are just buying our off
quality products at cheap prices, and should not be included in our "10
worst" analysis.

I have added "Not In ("custname1","custname2" and so on) to my query
criteria line and that works fine, but for future ease of upkeep I thought I
would make a table of customers to not include in the "10 worst" query and
reference that, however I cannot get it to work so far. How do I reference
the table in my "Not In ( )" criteria area or can that even be done?


NOT IN (SELECT CustID FROM tblExceptions....)

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201004/1

 




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 02:15 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.