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

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> SQL queries    
 
   
monadel
post Mar 17 2008, 09:32 PM
Post #1

UtterAccess Addict
Posts: 164



Hi guys,

I have a lil problem here with query.

I have 2 tables. say A & B
in table A I have list number 1 to 8

A: ..... B:
1 ..... 1 01/03/08
2 ..... 8 01/03/08
3 ..... 5 01/03/08
4 ..... 6 01/03/08
5 ..... 2 02/03/08
6 ..... 5 02/03/08
7 ..... 7 02/03/08
8 ..... 8 02/03/08

Then, I want to make a query with a result of all number in A but not in 02/03/08 (Also, I dont want number 5 and 8 as well because they already in 02/03/08). The result must be 1,3,4,6

Can anyone help me please.

Thank you so much.
Go to the top of the page
 
+
datAdrenaline
post Mar 17 2008, 10:02 PM
Post #2

UtterAccess Editor
Posts: 16,027
From: Northern Virginia, USA



... I am sorry ... but I am not following what you are after .... can you try to explain it again please? ... I know you have table A with numbers 1 through 8 ... but where do the dates come from? ... is "B" a table? or the result you expect?
Go to the top of the page
 
+
vtd
post Mar 17 2008, 11:29 PM
Post #3

Retired Moderator
Posts: 19,667



It sounds to me that you want the "double negation" method in UA Thread 1608745.

If I understand your requirement correctly, the SQL String should be something like:
CODE
SELECT A.NumberField
FROM A LEFT JOIN
(
  SELECT B.NumberField
  FROM B
  WHERE B.DateField = #2008-03-02#
) AS SQ
ON A.NumberField = SQ.NumberField
WHERE (SQ.NumberField Is Null)
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: 18th June 2013 - 09:28 PM