如何从Access数据库中获取包含空值的数据 [英] How to fetch data from access database which contains null value

查看:168
本文介绍了如何从Access数据库中获取包含空值的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个具有RegistrationNo,Barcode,VehicleModel,FuelType,RegistrationDate,InsuranceDate和PUCDate列的访问数据库.

我正在尝试执行查询
从VehicleMaster中选择RegistrationNo作为RegistrationID,条形码,VehicleModel,FuelType,RegistrationDate,InsuranceDate,PUCDate,其中cdate(PucDate)> = cdate(format(''01-07-2012'',"dd-mm-YYYY"))和cdate(PucDate)< = cdate(format(''01-07-2012'',"dd-mm-YYYY"))通过条形码进行排序"

但是我收到错误消息无效使用Null",因为PUCDate列中有一个null值.

谁能帮我解决这个错误

在此先感谢

解决方案

,您需要使用等效于SQL ^ ]是 IIF(ISNULL(column),0,column) [ ^ ]


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

解决方案

you need the Access equivalent of SQL ISNULL(a,b)[^] which is IIF(ISNULL(column),0,column)[^]


这篇关于如何从Access数据库中获取包含空值的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆