June 3, 200619 yr I'm having another brain cramp. I'm writing a "merge" script... idea is to take several contact records that really are the same person and merge them into one record. Without going into a whole lot of detail... if I have two records in the same source table and record B has some fields empty that record A has data in, what's the best way to get the data from A into just the empty fields in B? Thought about setting a bunch of variables then going to B and checking, field by field, to see which are empty, then SetFielding them to the appropriate variable if empty and moving on if not empty. But something tells me there is a better way. ... or is that wishful thinking?
June 3, 200619 yr You havn't said what to do with records with discrepancies beyond some being empty, so I've take myself the liberty to take the first in the sortorder of those fields containing data which my template shows... be cautioned that some language preferences makes... say "aa" in my language the same as "å" arrive last in the sortorder... But as I see the task here is it just to pick one ...syncronization is an entire different business. The next encounter of problem is what if the key'ish value misses as well. --sd pling.zip
June 6, 200619 yr Author Thanks... yes, with other disprepancies I think I'll just leave the values unchanged in the "merge to" record. So the idea is just to use what's in the others to fill in holes in the final record... of course, then there's the question of which of "the others" to use to fill in the empty field if those disagree. Hadn't thought about that. This is a bit thornier than I'd figured. Thanks for the file, I'll definitely study it!
June 7, 200619 yr You could change the relation to exclude the "merge to" record from the selfjoin! Make a multicriteria fork with the recordID as well (non equijoin) --sd
Create an account or sign in to comment