Hi Folks,
I need to update a foreign key column in a table. The data in my two tables is somewhat messy, and hence my query needs to be somewhat complicated. I'm not sure if it's better done in SQL or VB, and in either case, how. Here's what I need to do in psedo-code:
Code:
UPDATE table_1 t1, table_2 t2
IF t1.col1 NOT = "string1" or "string2" THEN
SET t1.t2ID = t2.ID WHERE
t1.match1 = t2.match1
ELSE
SET t1.t2ID = t2.ID WHERE
t1.match2 = t2.match2
I probably would prefer to do this via VB, as it might afford more flexibility into the future as I need to tweak things. But, my ears are wide open. Be it via VB or SQL, how might I do this?
Thanks a ton!