IsNull not working in query

hrdpgajjar

Registered User.
Local time
Tomorrow, 00:31
Joined
Sep 24, 2019
Messages
142
Hi all,
I have a table named "Master Data" having following columns

- Regi No
- Farmer Name
- MIS System
- Material Supply Date
- DD Or RTGS No
- Material Supply Date
- TPA Date


I am trying to run a query where,

- Material Supplied (Not Null)
-DD Or RTGS No Pending (Is Null)
- TPA Date pending (Is null)

It works properly but as is select "DD Or Rtgs No" as "Is Null"

it returns blank report.

Earlier this query works fine but suddenly stops working

Below is my SQL View

SELECT [Master Data].[DD Or Receipt No], [Master Data].[Material Supply Date], [Master Data].[WO Date], [Master Data].[TPA Date], [Master Data].[Regi No], [Master Data].[Farmer Name], [Master Data].[MIS System]
FROM [Master Data]
WHERE ((([Master Data].[DD Or Receipt No]) Is Null) AND (Not ([Master Data].[Material Supply Date]) Is Null) AND (Not ([Master Data].[WO Date]) Is Null) AND (([Master Data].[TPA Date]) Is Null));


There are some records having above criteria but it shows blank


help appreciated

Thanks
 
DD Or RTGS No
You are begging for problems with name schema like that. Never put spaces in a name, but for sure never put a space in a name with something like "And " or "Or"

DD_or_RTGS_NO is fine.

Readable.
SQL:
SELECT [master data].[dd or receipt no],
       [master data].[material supply date],
       [master data].[wo date],
       [master data].[tpa date],
       [master data].[regi no],
       [master data].[farmer name],
       [master data].[mis system]
FROM   [master data]
WHERE  ( ( ( [master data].[dd or receipt no] ) IS NULL )
         AND ( NOT ( [master data].[material supply date] ) IS NULL )
         AND ( NOT ( [master data].[wo date] ) IS NULL )
         AND ( ( [master data].[tpa date] ) IS NULL ) );

try
Code:
WHERE  ([master data].[dd or receipt no] ) is null AND [master data].[tpa date] IS NULL)
         AND NOT ( [master data].[material supply date] ) IS NULL AND  [master data].[wo date] IS NULL )
 
Last edited:
Are you positive your fields are not zero-length-strings rather than Null?
I have always used
FieldName Is Not Null
rather than
Not FieldName Is Null
 

Users who are viewing this thread

Back
Top Bottom