Click here to Skip to main content
15,663,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I am having an access database with RegistrationNo ,Barcode, VehicleModel, FuelType, RegistrationDate, InsuranceDate and PUCDate columns.

I am trying to execute a query
"select RegistrationNo as RegistrationID, Barcode, VehicleModel, FuelType, RegistrationDate, InsuranceDate, PUCDate from VehicleMaster where cdate(PucDate)>=cdate(format('01-07-2012',"dd-mm-YYYY")) and cdate(PucDate)<=cdate(format('01-07-2012',"dd-mm-YYYY")) order by Barcode"

But i am getting an error "Invalid use of Null" because there is one null value in PUCDate column.

Can anyone help me how to solve this error

Thanks in advance

1 solution

you need the Access equivalent of SQL ISNULL(a,b)[^] which is IIF(ISNULL(column),0,column)[^]
Share this answer
VJ Reddy 14-Jun-12 5:52am    
Good answer. 5!
MarqW 14-Jun-12 9:53am    
Can also use "Nz(a,b)" :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900