access 数据库 按日期类型查询数据 报错!

来源:互联网 发布:java builder模式 编辑:程序博客网 时间:2024/04/29 22:54
<span style="font-size:18px;">select * from sv_JFVoucher  where isDelete=0  and  [date]>= '2015-1-20 0:00:00'  and  [date]<= '2015-1-20 0:00:00'   order by id desc</span>

 这条sql 语句在SqlServer08中执行是无错误的,可是在access数据库中执行就报错!

百度了一下,说把 

<span style="font-size:18px;">'2015-1-20 0:00:00'修改成#2015-1-20 0:00:00#</span>
</pre><p></p><pre>


<span style="font-size:18px;"><span style="background-color: rgb(240, 240, 240);">select * from sv_JFVoucher  </span></span>
<span style="font-size:18px;">where isDelete=0  and  [date]>= #2015-1-20 0:00:00#  and  [date]<= #2015-1-20 0:00:00#   order by id desc</span>

<span style="font-size:18px;">运行真的成功了,我刚接触access,表示不解</span>

  

1 0