Full Version: Iif Isnull Still Returning Blank Field
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
TheDude76
I have a query that I am using an IIf IsNull statement in 3 different fields. The issue that I am having is that even with the IIf IsNull, I am still receiving a blank field in the query results. Here is the sql for the query:

CODE
SELECT qrySecurityYesNoNA.Site, qrySecurityYesNoNA.Date, IIf(IsNull(qrySecurityYesNoNA![Security Yes]),0,qrySecurityYesNoNA![Security Yes]) AS [Security Yes], IIf(IsNull(qrySecurityYesNoNA.[Security No]),0,qrySecurityYesNoNA.[Security No]) AS [Security No], IIf(IsNull(qrySecurityYesNoNA![Security N/A]),0,qrySecurityYesNoNA![Security N/A]) AS [Security N/A]
FROM qrySecurityYesNoNA
GROUP BY qrySecurityYesNoNA.Site, qrySecurityYesNoNA.Date, IIf(IsNull(qrySecurityYesNoNA![Security Yes]),0,qrySecurityYesNoNA![Security Yes]), IIf(IsNull(qrySecurityYesNoNA.[Security No]),0,qrySecurityYesNoNA.[Security No]), IIf(IsNull(qrySecurityYesNoNA![Security N/A]),0,qrySecurityYesNoNA![Security N/A]);


Any ideas?
RAZMaddaz
Have you tried using the Len function instead? Here is a link to an explanation in the differences between the two.

Len function
TheDude76
Thanks RAZ. That worked!! smile.gif
RAZMaddaz
Awesome!!! Glad I could help!!!

RAZMaddaz
yw.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.