Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old March 29th, 2004, 06:03 PM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default INNER JOIN Not EQUAL

I have 2 Tables both are have the same structured.
let say
Table 1 Table 2
FName FNAMe
MNAme MNAme
LNAMe LNAMe

I want to see all Match records from Table2 to Table1

Ok I used Inner Join on FNAME = FNAMe... etc..
I got the correct Results.

Now the problem is I want to get all records that are not matched from both tables.
What queries should I Use?

Appreciate all your help

Thanks,
ELmer
  #2 (permalink)  
Old March 29th, 2004, 08:35 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this:

SELECT Table2.FName
FROM Table2
WHERE (((Table2.FName) Not In (SELECT Table1.FName FROM Table1 INNER JOIN Table2 ON Table1.FName = Table2.FName)))
Union
SELECT Table1.FName
FROM Table1
WHERE (((Table1.FName) Not In (SELECT Table1.FName FROM Table1 INNER JOIN Table2 ON Table1.FName = Table2.FName)));

There may be an easyer way

  #3 (permalink)  
Old March 30th, 2004, 01:01 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: Madison, Wisconsin, USA.
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

You may want to try using the Find Unmatched query wizard. Just select the table that has records that do not match those in the other table

Quote:
quote:Originally posted by JimYellow
 Try this:

SELECT Table2.FName
FROM Table2
WHERE (((Table2.FName) Not In (SELECT Table1.FName FROM Table1 INNER JOIN Table2 ON Table1.FName = Table2.FName)))
Union
SELECT Table1.FName
FROM Table1
WHERE (((Table1.FName) Not In (SELECT Table1.FName FROM Table1 INNER JOIN Table2 ON Table1.FName = Table2.FName)));

There may be an easyer way

Ben Horne
Madison Area Technical College student
-------------------------
http://community.webshots.com/user/valerian114

Go there. I have a lot of awesome photos that I rendered myself

"A Person Who Claims To Be A Flash Junkie Isn't Really A Flash Junkie Unless He Can Prove It"
  #4 (permalink)  
Old May 8th, 2017, 01:35 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default INNER JOIN Not EQUAL

Instead of this you can use this method:


SELECT * FROM table1 LEFT JOIN table2 ON table2.number = table1.number WHERE table2.number is NULL OR table1.number is NULL


It works ...


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's behind the 'Equal' and 'LinkedList' buttons Everard Hughes BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1 1 September 27th, 2008 08:44 AM
~* Total pages are not equal *~ chakravarthy_vr Reporting Services 2 October 13th, 2006 03:56 PM
Oracle 8i inner join and left join problem puteri_84 Oracle 2 August 19th, 2004 07:14 AM
Multiple Not Equal rylemer Access 5 January 23rd, 2004 04:59 PM
How to "Set" a function equal to a DataReader DittoToo ASP.NET 1.0 and 1.1 Basics 1 July 1st, 2003 10:15 AM





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