Right,
I have a table that contains some duplicate records.
These records are duplicate because they share the same personell number.
These records contain more fields however. A name field and two date fields.
the name field is not to be altered. But the date fields i need to range from the lowest to the higest.
Lets say we have these records :
Personell number Name Validfrom Validto
997865 JeroenMioch 23-03-2012 30-05-2012
997865 JeroenMioch 27-04-2012 02-07-2012
So this is what i want the output to be :
997865 JeroenMioch 23-03-2012 02-07-2012
I figuered that the easiest way is to make an update SQL that spots the lowest date of the Validfrom field and updates the higest, and do the same with the validto field but then find the higest date.
This way i end up with two identical records that contain data that i want, then run a delete duplicates query and im done.
But im really really lost on how to code the SQL string.
Anyone have any clue ?
Thanks for thinking with me.
Greetings : Jeroen