PDA

View Full Version : SQL problem with Null



DomFino
01-25-2011, 11:14 AM
I have an Access 2007 query with the following line of code:

IIf([tblmaster].[PLATOONID]=20 Or [tblmaster].[ID]=485,"FREE",[tblDuesYearsLKU].[DuesYears]) AS SWITCH

This code works fine unless there is a Null Value and what I do not know how to do is modify the code to use the IfNull parameter.

Any help will be appreciated.
Thanks

Bob Phillips
03-02-2011, 02:14 PM
IIf(IsNull([tblmaster].[PLATOONID]) Or IsNull([tblmaster].[ID]) Or [tblmaster].[PLATOONID]=20 Or [tblmaster].[ID]=485,"FREE",[tblDuesYearsLKU].[DuesYears]) AS SWITCH