UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Exclude Values from a Query.    
 
   
bmccallion
post Mar 11 2005, 06:34 AM
Post #1

New Member
Posts: 4



I have a table (tbl1) which stores certain values related from another table (tbl2). I want to Query (tbl2) but i want the query to exclude the values that are present in tbl1. I was wondering if anyone could help i am not having much success at the minute thanks.
Go to the top of the page
 
+
kikovp
post Mar 11 2005, 06:42 AM
Post #2

UtterAccess Veteran
Posts: 492
From: Lisboa, Portugal



Hi and welcome to UA (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)

Assuming that the two tables are related thru a field named ID, you could use something like:

SELECT Table2.*
FROM Table2 LEFT JOIN Table1
ON Table2.ID = Table1.ID
WHERE Table1.ID Is Null;

Hope this helps
Go to the top of the page
 
+
bmccallion
post Mar 13 2005, 02:43 PM
Post #3

New Member
Posts: 4



Yeah Worked A Treat thanks A lot!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 24th May 2013 - 06:55 PM

Tag cloud: