access根据时间查询数据怎么写啊?
要求是从去年的6月30号,查询到今年的7月1日。大家快帮帮忙啊!

解决方案 »

  1.   

    晕,这是个问题,我以前也碰到过,ACCESS通过时间会有问题,最后我也没有办法,只有将时间字段设成字符或把所有数据提出来判断,相信你还是用前一种方法好点。
      

  2.   

    select * from 表 where 时间>#2002-06-30# and 时间<#2003-07-01#
      

  3.   

    这样来写rq1  rq2 为一个日期
    select * from 表 where 时间>#"& format(rq1,"yyyy-mm-dd") & "# and 时间<#" & format(rq2,"yyyy-mm-dd") &"#
      

  4.   

    Dim strSQL As String
        strSQL = "select * from 门市开支明细表 where 日期 between " & "'" & txtDate1.Text _
                 & "' and " & "'" & txtDate2.Text & "' order by 日期"