开发者

ms access if in sql

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜