发新话题
打印

[基础] 如何显示ACCESS的日期与时间类型数据

如何显示ACCESS的日期与时间类型数据

用一个DateTimePicker控件的值作为数据源SQL语名的过滤条件,提示 " 标准表达式的数据类型不匹配",是不是要用FORMAT函数?我把SQL语句写成:  
Select * from 表 where 日期  <= '" & format(DTPicker2.Value) & "' and 日期 >= '" & format(DTPicker1.Value) & "'"
这样写还是报上述错。

TOP

Select * from 表 where 日期  <= #" & format(DTPicker2.Value) & "# and 日期 >= #" & format(DTPicker1.Value) & "#"
access的日期用#,不要用'
换个头像,看见广告就眼红,直接封ID。

TOP

发新话题