MS Access SQL在字段值中替换NULL

时间:2011-08-01 15:25:52

标签: ms-access

如果字段中的值为null或其值为if,我想显示值“NONE” 使用select语句的表中的字段不为null。 声明可能与此类似:

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

1 个答案:

答案 0 :(得分:13)

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

"NONE"会将spouse替换为NULL,否则会返回spouse