Jump to content

copy some fields to empty ones in another record?

This topic is 5664 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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.



Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This topic is 5664 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.