如何将所有记录的空白(null)值替换为0?
问题描述:
MS Access:如何将所有记录的空白(空值)替换为0?
MS Access: How to replace blank (null ) values with 0 for all records?
我猜想它必须使用SQL来完成.我可以使用查找并替换"将0替换为空格,但不能用另一种方式替换(即使我输入要插入空格的[Ctrl-空格键]也不会找到"空白.
I guess it has to be done using SQL. I can use Find and Replace to replace 0 with blank, but not the other way around (won't "find" a blank, even if I enter [Ctrl-Spacebar] which inserts a space.
所以我想我需要在SQL中找到MyField的空值,然后将它们全部替换为0.
So I guess I need to do SQL where I find null values for MyField, then replace all of them with 0.
答
转到查询设计器窗口,切换到SQL模式,然后尝试以下操作:
Go to the query designer window, switch to SQL mode, and try this:
Update Table Set MyField = 0
Where MyField Is Null;