开发者

MS Access SQL replace NULL in field value

开发者 https://www.devze.com 2023-03-25 15:11 出处:网络
I would like to show the value\"NONE\" if the value in a field is null OR its value if th开发者_如何学Ce field is not null from a table using select statement.

I would like to show the value "NONE" if the value in a field is null OR its value if th开发者_如何学Ce field is not null from a table using select statement. The statement may be similar to this:

select iif(isnull(spouse),"NONE",spouse) as spouse from biodata


SELECT Nz(spouse,"NONE") AS Nzspouse FROM biodata

Nz() replaces spouse with "NONE" if spouse was NULL, otherwise it returns spouse.

0

精彩评论

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