I have a field in a vehicle table that is a unique code consisting of a 3 digit number and 2 letters. So it looks like this:-
eg.
003AA
003AB
003AC
021JA
021JB
021JC
I have another table that holds new records that I eventually want to add to the first table but the field in the second table only contains the 3 digit number part of this unique code. So the second table looks like this:-
Code, Make, Model
003, AUDI, A4 TDI QUATTRO SPORT
003, AUDI, A4 CABRIOLET
021, FORD, SIERRA LX
021, FORD, SIERRA GLX AUTO
etc...
I want to create a query or something to search the first table for the code on the second table and where I find the 3 digit number (eg. 003), I want to find the next unique code up that I can use, that is not already in use. So I would want it to find new code 003AD for the first vehicle of the example above, because 003AA, 003AB and 003AC are all already in use for other vehicles.
I have no idea how to do this automatically but I am tired of doing this as a manual exercise.
I would really appreciate any help or ideas... Thank you
eg.
003AA
003AB
003AC
021JA
021JB
021JC
I have another table that holds new records that I eventually want to add to the first table but the field in the second table only contains the 3 digit number part of this unique code. So the second table looks like this:-
Code, Make, Model
003, AUDI, A4 TDI QUATTRO SPORT
003, AUDI, A4 CABRIOLET
021, FORD, SIERRA LX
021, FORD, SIERRA GLX AUTO
etc...
I want to create a query or something to search the first table for the code on the second table and where I find the 3 digit number (eg. 003), I want to find the next unique code up that I can use, that is not already in use. So I would want it to find new code 003AD for the first vehicle of the example above, because 003AA, 003AB and 003AC are all already in use for other vehicles.
I have no idea how to do this automatically but I am tired of doing this as a manual exercise.
I would really appreciate any help or ideas... Thank you
Comment