Matched Query (1 Viewer)

TimTDP

Registered User.
Local time
Today, 15:23
Joined
Oct 24, 2008
Messages
210
I am looking for a query that will return records from a table that have related records in another table. Opposite to the Unmatched Query Wizard

I have two tables: tblSupplier and tblSupplierProducts
The two tables are related by the field "SupplierId"

I need the query to only return Suppliers that have Products.

Can someone please assist

Thanks in advance
 

plog

Banishment Pending
Local time
Today, 07:23
Joined
May 11, 2011
Messages
11,648
No offense, but your request doesn't make sense in the context of your time here. You've been registered here for over 7 years with near 200 posts and this is a remedial query (at least the one you have described). I really think I am missing something. Here's a great site for learning about simple queries:

http://www.w3schools.com/sql/

Surely you have done a simple join on tables. What have you tried so far and how hasn't it worked?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:23
Joined
Feb 19, 2013
Messages
16,619
just use an inner join on supplierid between the two tables

Code:
 SELECT DISTINCT tblsupplier.* 
 FROM tblSupplier INNER JOIN tblSupplierProducts 
     ON tblSupplier.supplierid = tblSupplierProducts.supplierid
 
Last edited:

TimTDP

Registered User.
Local time
Today, 15:23
Joined
Oct 24, 2008
Messages
210
Thanks CJ_London

plog, you are 100% correct.
Just wasn't thinking straight. Think it is time to quit for the day and have a glass off....
 

Users who are viewing this thread

Top Bottom