Re: Newbie: Select records in Table A not in Table B

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ken Snell (kthissnellis9_at_notcomcast.realnet)
Date: 02/06/04


Date: Thu, 5 Feb 2004 23:04:29 -0500

You use an Outer Join to do this. Something like this:

SELECT A.* From A
LEFT JOIN B ON
A.[client number] = B.[client number]
WHERE B.[client number] Is Null;

-- 
       Ken Snell
<MS  ACCESS MVP>
"Terry" <anonymous@discussions.microsoft.com> wrote in message
news:b71501c3ec64$e5704210$a401280a@phx.gbl...
> I have a table A which has details of all potential
> clients in it. I have another table B of actual clients.
> Both tables have a common field (client number). I now
> just want a query which selects the clients from table A
> which are not in table B, in order words, I want a list of
> potential clients only. I've now spent several hours
> trying to find out how to do this but to no avail. I am
> pretty sure the answer to this is dead simple.
>
> Any help would be greatly appreciated and would save me
> many more hours of fruitless, frustrating foraging through
> books and over the internet.
>
> Terry.


Relevant Pages

  • Access2k + SQL 7.0 Lock problem
    ... I have an Access database which has tables linked to SQL Server 7.0 ... Clients ... SummaryMaxDate INNER JOIN ... SummaryMaxDate.ClientKey = Clients.ClientKey LEFT OUTER JOIN ...
    (microsoft.public.access.queries)
  • Re: is there a "does not include" query in Access
    ... You can use the In operator or the EXISTS Clause. ... you can simple use a Left Outer Join like: ... FROM tblClient AS C LEFT JOIN ... > create a report that shows me which clients we have not received work for. ...
    (microsoft.public.access.queries)
  • Re: Reconcilliation
    ... tables doing a left outer join will give u the result ... out if any of the tables are missing records for any of the clients ... > TFees ... > TUsers ...
    (microsoft.public.sqlserver.programming)
  • Re: Get a value from a table in an HTML document
    ... I need to do a review of all clients that called back with a repeat ... dynamic html document where the fields are all ... Im trying to get the Date and email address to be placed into my excel ... Terry V ...
    (microsoft.public.excel.programming)
  • Re: 1st-Line 2nd Rate
    ... > It would also not surprise me if one or more of these people have already ... > added your name to a list of clients or potential clients whose business ... > one are the sort of threads that the dealers make a point of reading. ... > potential clients whose business is not welcomed. ...
    (alt.coffee)