isladogs
MVP / VIP
- Local time
- Today, 01:12
- Joined
- Jan 14, 2017
- Messages
- 18,221
jdraw/mark
Just to confirm, the OP did say all fields were numbers.
He also said there were about 10000 records in the reference table used for the update (tblList) but up to a million records in all (presumably in tblFinal)
Therefore whilst I agree that there is nothing in this code to prevent updates being repeated unnecessarily, the suggested query should do the job ...once PK fields have been assigned ... and indexing added
Just to confirm, the OP did say all fields were numbers.
He also said there were about 10000 records in the reference table used for the update (tblList) but up to a million records in all (presumably in tblFinal)
Therefore whilst I agree that there is nothing in this code to prevent updates being repeated unnecessarily, the suggested query should do the job ...once PK fields have been assigned ... and indexing added
Code:
UPDATE tblFinal INNER JOIN tblList ON tblFinal.Type = tblList.Range SET tblFinal.Customer = tblList.Customer
WHERE (((tblFinal.CodeNumber) Between [tblList].[StartRange] And [tblList].[EndRange]));