SQL 获取Access中特定列为空的所有记录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5170865/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 09:31:16  来源:igfitidea点击:

Getting All Records where Particular Column is empty in Access

sqlms-access

提问by itsaboutcode

I am writing a query in Access where I have to get all the records where a particular column is empty, how I can do this?

我正在 Access 中编写一个查询,我必须在其中获取特定列为空的所有记录,我该怎么做?

This is what I am thinking it should be, but its not working.

这是我认为应该是的,但它不起作用。

SELECT *
FROM TABLE
WHERE PARTICULARCOLUMN = ''

回答by Joe Stefanelli

This would handle both empty strings ('') and NULL values in the column.

这将处理列中的空字符串 ('') 和 NULL 值。

SELECT *
FROM TABLE
WHERE Nz(PARTICULARFIELD,'') = ''

回答by John K.

Try...

尝试...

WHERE PARTICULARFIELD Is Null 

Sample from Web:

来自网络的示例:

SELECT [Table1].[CustomerID], [Table2].[CustomerID]
FROM [Table1] LEFT JOIN [Table2] ON [Table1].[CustomerID] = [Table2].[CustomerID]
WHERE ((([Table 2].[CustomerID]) Is Null));

See: http://www.fabalou.com/access/Queries/isnullquery.asp

请参阅:http: //www.fabalou.com/access/Queries/isnullquery.asp