Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting All Records where Particular Column is empty in Access

Tags:

sql

ms-access

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?

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

SELECT *
FROM TABLE
WHERE PARTICULARCOLUMN = ''
like image 543
itsaboutcode Avatar asked Mar 02 '11 17:03

itsaboutcode


2 Answers

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

SELECT *
FROM TABLE
WHERE Nz(PARTICULARFIELD,'') = ''
like image 153
Joe Stefanelli Avatar answered Sep 28 '22 12:09

Joe Stefanelli


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

like image 34
John K. Avatar answered Sep 28 '22 12:09

John K.