Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2005, 03:05 PM
AJ AJ is offline
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query to display non matching records.

Can a query be constructed in MS Access to display non matching records from two tables?

 
Old April 7th, 2005, 05:05 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default


SELECT *
FROM tbl1
WHERE tbl1.ID NOT IN (SELECT ID
                       FROM tbl2);


SELECT *
FROM tbl1
WHERE tbl1.ID NOT IN (SELECT ID
                           FROM tbl2) OR
       tbl1.FName NOT IN (SELECT FName
                                  FROM tbl2);


You also can concatenate fields:
Code:
SELECT *
FROM   tbl1
WHERE  tbl1.ID & tbl1.FName NOT IN (SELECT ID & FName 
                                    FROM   tbl2);





Similar Threads
Thread Thread Starter Forum Replies Last Post
display Records in ComboBox therese C# 2005 4 July 26th, 2008 05:28 AM
Matching query - stumped SQLScott SQL Server 2005 9 December 6th, 2007 12:01 PM
javascript - display items in listbox matching the sansircar ASP.NET 1.0 and 1.1 Professional 1 February 6th, 2007 07:04 AM
Display 0 when no records found in a query awwhite Access VBA 1 December 2nd, 2004 03:39 PM
ADODB Finding matching records rjp Access VBA 0 August 25th, 2004 07:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.