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  

Excluding



 
 
Thread Tools Display Modes
  #1  
Old February 22nd, 2007, 08:22 PM posted to microsoft.public.access.queries
gmore
external usenet poster
 
Posts: 13
Default Excluding

Hello,

I've got a table containing suppliers (two fields: supplier_code and
supplier_name) and another one containing suppliers' codes to exclude from
showing up. Since I've got more than 45 suppliers to exclude, I've given up
with the idea of putting everything in the criteria with the "not like"
expression.

Is someone know how to perform this condition in my query? If yes, any
suggestions?

Thanks,
gmore
  #2  
Old February 22nd, 2007, 09:04 PM posted to microsoft.public.access.queries
Jason Lepack
external usenet poster
 
Posts: 600
Default Excluding

/* Powered by General SQL Parser (www.sqlparser.com) */

SELECT S.supplier_code,
S.supplier_name
FROM tbl_suppliers AS S
LEFT JOIN tbl_exclude AS E
ON S.supplier_code = E.supplier_code
WHERE E.supplier_code IS NULL

tbl_suppliers - the table that you want to select the data from
tbl_exclude - the table with the supplied codes you want to exclude

This will select all records from tbl_suppliers where there is no
match in tbl_exclude.

Cheers,
Jason Lepack

On Feb 22, 3:22 pm, gmore wrote:
Hello,

I've got a table containing suppliers (two fields: supplier_code and
supplier_name) and another one containing suppliers' codes to exclude from
showing up. Since I've got more than 45 suppliers to exclude, I've given up
with the idea of putting everything in the criteria with the "not like"
expression.

Is someone know how to perform this condition in my query? If yes, any
suggestions?

Thanks,
gmore



  #3  
Old February 22nd, 2007, 11:30 PM posted to microsoft.public.access.queries
gmore
external usenet poster
 
Posts: 13
Default Excluding

Thanks

"Jason Lepack" wrote:

/* Powered by General SQL Parser (www.sqlparser.com) */

SELECT S.supplier_code,
S.supplier_name
FROM tbl_suppliers AS S
LEFT JOIN tbl_exclude AS E
ON S.supplier_code = E.supplier_code
WHERE E.supplier_code IS NULL

tbl_suppliers - the table that you want to select the data from
tbl_exclude - the table with the supplied codes you want to exclude

This will select all records from tbl_suppliers where there is no
match in tbl_exclude.

Cheers,
Jason Lepack

On Feb 22, 3:22 pm, gmore wrote:
Hello,

I've got a table containing suppliers (two fields: supplier_code and
supplier_name) and another one containing suppliers' codes to exclude from
showing up. Since I've got more than 45 suppliers to exclude, I've given up
with the idea of putting everything in the criteria with the "not like"
expression.

Is someone know how to perform this condition in my query? If yes, any
suggestions?

Thanks,
gmore




 




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 11:49 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.