Is there a way to combine 2 tables-from 2 different databases-they are both students table but they also both have their own autonumber for id-so many numbers are duplicated.
thank you in advance
If the Autonumber IDs are duplicated, you obviously won't be able to use the field as a unique identifier, but you can create a new Id and use that in your new database.
If you create a UNION query, you could modify the Id to make it unique.
SELECT 2*lngStudentId as lngNewStudentId, Field2, Field3 FROM tblStudents0
UNION
SELECT 1+2*lngStudentId, Field2, Field3 FROM tblStudents1
would do it.
In this way lngNewStudentId Mod 2 would give you the number of the tblStudents table it came from and the Id within that table would be Clng(lngStudentId/2) (I think that truncates, rather than rounds)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.