首页 > 数据库 > 其他综合 >

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

2015-01-24

<span style="font-size:18px;">select * from sv_JFVoucher where isDelete=0 and [date]>= & 39;2015-1-20 0:00:00& 39; and [date]<= & 39;2015-1-20 0:00:00& 39; order

<span style="font-size:18px;">select * from sv_JFVoucher  
where isDelete=0 
 and  [date]>= &#39;2015-1-20 0:00:00&#39;
  and  [date]<= &#39;2015-1-20 0:00:00&#39; 
  order by id desc</span>

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

百度了一下,说把

<span style="font-size:18px;">&#39;2015-1-20 0:00:00&#39;修改成#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 &#160;</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>

相关文章
最新文章
热点推荐