views:

28

answers:

1

I am trying to update the column called NewNumber. What I want to do is if the column phone_code has 1 in it, I want to update the column NewNumber with the value of the phone_number column. But if it is anything else than 1 then I want to concatenate the phone_code and phone_number columns and update NewNumber column. Below is the code I tried but that doesnt work

 update Arvada_N set NewNumber =  IIf([phone_code = 1], phone_number, [phone_code&phone_number]);  

Any help will be appreciated

+1  A: 

Never mind, this works

update Arvada_N set NewNumber =  IIf([phone_code] = '1', phone_number, [phone_code]&[phone_number]);