Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Appending non-duplicate records

Status
Not open for further replies.

achillese

Technical User
Joined
Jun 26, 2005
Messages
25
Location
AU
Hi,

I would like some assistance on this append query. If I remove the INNER JOIN, the link source table, and just add the fields from the source table the query works. Otherwise, the query below doesn't work.

Is it because i link two fields? or
Is is because in my WHERE CLAUSE i have two conditions, one of which from another table?

Please help!!!

INSERT INTO [TargetTable] ( [Batch Number], [Activation Dealer], IMEI, [Activation Dealer Name], [Material Code], [Material Description], [Order], [Invoice Number], [Shipment Date

FROM [SourceTable] INNER JOIN [TargetTable] ON ([SourceTable].[Batch Number] = [TargetTable].[Batch Number]) AND ([SourceTable].IMEI = [TargetTable].IMEI)

WHERE ((([SourceTable].[Batch Number])>="00316") AND (([SourceTable].IMEI)<>[TargetTable]![IMEI]));
 
You have conflicting conditions.
The join requires equality for IMEI values but the 'where' clause requires them to be different.

Only one of these can be true, so you will never select any records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top