Minggu, 20 September 2015

Re: [MS_AccessPros] How to eliminate records

 

Jan-


SELECT tblOne.*
FROM tblOne
WHERE tblOne.Id NOT IN
(SELECT ID FROM tblTwo WHERE Activity = "Yard Sign");

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Sep 20, 2015, at 9:38 PM, jan.hertzsch@gmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I am trying to create a query that will exclude certain records.  I have joined a table with (ID) name/address to a table with ID and activity.

So table one has: record 10 John Smith 123 Main Street
Table two has: 3 records for John Smith (ID=10)
  • 10 | donor
  • 10 | yard sign
  • 10 | canvasser

I want to run a query where I exclude anyone (John Smith) who already has a yard sign.  If I say not 'yard sign' in my criteria, I still get John Smith because he has donor and canvasser records.


Thanks


   



__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post • Reply to sender • Reply to group • Start a New Topic • Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar