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 = ''
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 = ''
This would handle both empty strings ('') and NULL values in the column.
SELECT *
FROM TABLE
WHERE Nz(PARTICULARFIELD,'') = ''
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));
In my case, I wanted to find all records with a particular field empty. Not NULL didn't work. This did: WHERE ((Not (table.field)="").
So, to find both the empties and the nulls, just to be sure...
WHERE (((table.field)="" Or (table.field) Is Null)
© 2022 - 2024 — McMap. All rights reserved.