Convert null to value in Access query

I am trying to compare the same field in two reports to determine if the value has changed.  I got the code written below which works; however, there are null values that aren't being picked up so i needed to convert them to a value to they are identified within the query.  

Upon doing research i thought i could use the isnull and then put the value in it, but it says i am using wrong number of arguments with function in query expression.    

Working Code
SELECT Position_Database.Position, WFV.Position, Position_Database.Name, WFV.Name
FROM Position_Database LEFT JOIN WFV ON Position_Database.Position = WFV.Position
WHERE Position_Database.Name <> WFV.Name;

I thought I could do IsNull([Position_Database.Name],0)
jsawickiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jsawickiAuthor Commented:
I was able to get it working doing this

SELECT Position_Database.Position, WFV.Position, Position_Database.Name, WFV.Name
FROM Position_Database LEFT JOIN WFV ON Position_Database.Position = WFV.Position
WHERE (((Position_Database.Name)<>[WFV].[Name])) OR (((Position_Database.Name) Is Null) AND ((WFV.Name) Is Not Null)) OR (((Position_Database.Name) Is Not Null) AND ((WFV.Name) Is Null));

But wanted to know if there was a simplier way.
0
SharathData EngineerCommented:
You can try like this. 'zzz' is any dummy value which does not exist in your data.
SELECT Position_Database.Position, WFV.Position, Position_Database.Name, WFV.Name
FROM Position_Database LEFT JOIN WFV ON Position_Database.Position = WFV.Position
WHERE ISNULL(Position_Database.Name,'zzz') <> ISNULL(WFV.Name,'zzz');

Open in new window

0
Dale FyeCommented:
In Access you would use the NZ( ) function which is generally equivalent to the SQL Server IsNull( ) function.  In the case of the NZ( ) function, it will assess whether the first argument is NULL and if so, return the 2nd Argument.  So you could use:

WHERE NZ([Position_Database.[Name], "ZZZ") <> NZ(WFB.[Name], "ZZZ")

[Name] is a reserved word in Access, so when you use it as a field name, you should always wrap it in brackets.
0
mbizupCommented:
The Nz method that fyed mentioned is the 'simpler method' working in the Access environment.

However if, as your topics imply, you are working in the  .Net environment, it is not an option (you are only connecting to the tables...not Access's built in VBA environment/ methods). The solution you came up with is as good as any.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.