开发者

ms access if in sql

开发者 https://www.devze.com 2023-01-16 02:44 出处:网络
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

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 anyt开发者_Go百科hing 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


Never mind, this works

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

精彩评论

暂无评论...
验证码 换一张
取 消