NOT IN operator not working with subquery.

From: Terry (ttrapp.spam.me.not_at_org.insurors)
Date: 10/26/04


Date: Tue, 26 Oct 2004 16:08:03 -0500

I want to get a list of company names that we have in our database, that we
have not ever sent an invoice to. Why does the following query not work? I
have been banging my head on this for about an hour and can't figure it out.
Any help would be much appreciated.

SELECT [Companyinfo].[Name], [Companyinfo].[ID#] FROM [Companyinfo] WHERE
[Companyinfo].[ID#] NOT IN (SELECT [Link ID] FROM [Invoices]);

[Invoices].[Link ID] points to [Companyinfo].[ID#]

-- Terry



Relevant Pages

  • Re: NOT IN operator not working with subquery.
    ... >>I want to get a list of company names that we have in our database, ... >> have not ever sent an invoice to. ... Why does the following query not work? ...
    (microsoft.public.access.queries)
  • Re: Split database continued
    ... The code for creating a one off invoice takes 12 seconds with the database ... Private Sub Create_New_Invoice_Click ... Dim Invs As DAO.Recordset ...
    (microsoft.public.access.formscoding)
  • Re: Problem with a template from the MS Office website
    ... noted and have resolve them and reposted them the updated db to our web. ... database. ... I suspect it will be ages before my Access and VBA ... and controls so that the Invoice Report ...
    (microsoft.public.access.reports)
  • Re: A Challenge?
    ... It then creates a new new invoice, ... > that would get updated in the main database and also added to ... An item can be on an uncomplete trade counter invoice when a counter ... >> exponentialy slower as the database grows. ...
    (comp.sys.acorn.apps)
  • Re: Large Lists - Please read and comment
    ... When I explain better techniques used with C/S, ... > upsizing the database. ... I have invoice and payment transactions for over 200 different ... >>> incorrect in a number of ways such as wrong company, wrong customer, ...
    (microsoft.public.fox.programmer.exchange)