I need to check if the reference number my query creates, already exists in the table it's being appended to. EG does the query on table A which creates the value '1403ABCDEF01' already exist in table B in the reference field. if it does, change the last 2 digits to 02 and check again until value isnt found and so can be imported.
Please let me know if I need to clarify further.
Please let me know if I need to clarify further.