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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
field not equal
I am creating a query , say Query1 in which I am joining 2 queries, say
Query2 and Query3. I have joined them on a common field, say Field1. Values of Field1 are such that the set of these values in Query2 is a subset of that of Query1. I want Query1 to result only those records from Query1 where the field values of Field1 are not equal, that is present in Query1 and not in Query2. |
#2
|
|||
|
|||
I think you have mixed up your references to Queries 1, 2, and 3.
If you want Query1 to return all the records from Query3 that do not have a match in Field1 of Query2, then you can do it one of several ways. You might want to test both methods to determine which is quickest in your situation. 1. SELECT Query3.* FROM Query3 LEFT JOIN Query2 ON Query3.Field1 = Query2.Field1 WHERE Query2.Field1 IS NULL 2. SELECT Query3.* FROM Query 3 WHERE Query3.Field1 NOT IN (SELECT Query2.Field1 FROM Query2) HTH Dale "neeraj" wrote in message ... I am creating a query , say Query1 in which I am joining 2 queries, say Query2 and Query3. I have joined them on a common field, say Field1. Values of Field1 are such that the set of these values in Query2 is a subset of that of Query1. I want Query1 to result only those records from Query1 where the field values of Field1 are not equal, that is present in Query1 and not in Query2. |
#3
|
|||
|
|||
Thanks, I did mix up the references but you understood it correctly. I used
the first method as it seemed easier to implement that in design grid of Access query and it worked "Dale Fye" wrote: I think you have mixed up your references to Queries 1, 2, and 3. If you want Query1 to return all the records from Query3 that do not have a match in Field1 of Query2, then you can do it one of several ways. You might want to test both methods to determine which is quickest in your situation. 1. SELECT Query3.* FROM Query3 LEFT JOIN Query2 ON Query3.Field1 = Query2.Field1 WHERE Query2.Field1 IS NULL 2. SELECT Query3.* FROM Query 3 WHERE Query3.Field1 NOT IN (SELECT Query2.Field1 FROM Query2) HTH Dale "neeraj" wrote in message ... I am creating a query , say Query1 in which I am joining 2 queries, say Query2 and Query3. I have joined them on a common field, say Field1. Values of Field1 are such that the set of these values in Query2 is a subset of that of Query1. I want Query1 to result only those records from Query1 where the field values of Field1 are not equal, that is present in Query1 and not in Query2. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Memo Field | Sam | General Discussion | 12 | November 10th, 2005 09:16 PM |
setting report field equal to form field | T Best | General Discussion | 1 | April 22nd, 2005 08:10 PM |
Syntax needed to get needed reports | Frank Lueder | New Users | 15 | January 6th, 2005 08:39 AM |
Setting a value of a field equal to another automatically in a form | Chris | General Discussion | 7 | November 15th, 2004 06:11 PM |
Added text field to database. New entries not equal to "" ??? | Noozer | General Discussion | 3 | June 18th, 2004 01:33 AM |