A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Where Not Exists



 
 
Thread Tools Display Modes
  #11  
Old December 26th, 2009, 06:09 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Where Not Exists

Great. Glad you got this to work.

There is usually more than one way to get the desired results.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Sue Compelling wrote:
Hi John

Thanks for your efforts - I managed to find a similar post and John Vinson
recommended the Query Wizard - "Unmatched Records" - this was perfect for
what I wanted. I couldn't get the right join to work when I was doing it
myself because I wasn't putting null in the criteria for the "not wanted
records".

Cheers

  #12  
Old December 27th, 2009, 10:36 PM posted to microsoft.public.access.queries
PieterLinden via AccessMonster.com
external usenet poster
 
Posts: 307
Default Where Not Exists

John Spencer wrote:
Great. Glad you got this to work.

There is usually more than one way to get the desired results.


FWIW, I try to NEVER use IN/NOT IN with large datasets. Performance is
*awful*. You're much better off learning how to do outer joins and using
indexed columns in the join.

SELECT *
FROM tableA LEFT JOIN tableB ON tableA.PrimaryKeyField = tableB.
ForeignKeyField
WHERE tableB.ForeignKeyField IS NULL

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200912/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.