Re: Extract trades that do NOT match the other table
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Tue, 19 Feb 2008 08:33:00 -0500
Is ID field unique?
HOW do you determine which records in Table1 MATCH a record in Table2? Same
ID or a same ID and Name or a same ID, Name, and Amount?
Assuming that ID and Name both must match then try the following query.
SELECT Table1.*
FROM Table1 LEFT JOIN Table2
ON Table1.ID = Table2.ID
AND Table1.[Name] = Table2.[Name]
WHERE Table2.ID is Null
If only one field determines the match then use the Unmatched query wizard
to build your query.
-- Click New Query
-- Select find Unmatched Query Wizard
-- Follow the prompts.
You can even use the Unmatched query wizard to build the base of the query
on just one field and then modify the resulting query to include the
additional fields.
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"ali" <ali@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A27BD5BE-CF96-4648-ADAF-858991BEEEB2@xxxxxxxxxxxxxxxx
I have 2 tables.
Table1: All new trades, (ID, Name, Amount, Remarks)
Table2: All trades from before till now (ID, Name, Amount, Remark).
---------------------------------------------------------------------
I'd like to :
Link these two tables to extract the new trades, meaning trades in table1
which got no record in table2.
--------------------------------------------------------------------
Note:
I have another query to update into table2 everyday.
Thanks a lot, dear experts !
--
Allen Phailat Wongakanit
.
- References:
- Prev by Date: Re: Best Match Query
- Next by Date: Re: cannot write to database query
- Previous by thread: Re: Extract trades that do NOT match the other table
- Next by thread: Re: Convert Time "12:00:00 AM" into "12:00"
- Index(es):
Relevant Pages
|