txtSQL2 = " DateAlarm Between #" & DTPicker1 & "# and #" & DTPicker2 & "#"  上面这条语句在运行时 比较日期时 为什么没有DateAlarm等于DTpicker1这一天的记录,只有DateAlarm的值比它小一天才可以显示DTpicker1这一天的记录 将between换成>=也不行 什么原因 能解答一下么?DateAlarm 为日期的字符串形式下面紧跟一条语句为 txtSQL4 = "select * from STU where" & txtSQL2

解决方案 »

  1.   

    txtSQL2 = " DateAlarm Between #" & DTPicker1 & " 00:00:00# and #" & DTPicker2 & " 23:59:59#"  
      

  2.   


    txtSQL2 = " DateAlarm Between #" & DTPicker1 & "# and #" & DTPicker2 & "#"  默認意思是什么?
      

  3.   

    这个运行时 会有语法错误 现象是 当用DTpicker1控件选择日期时 后面会自动加上今天的时分秒,与DTPicker1 & " 00:00:00冲突了 怎么解决?
      

  4.   

    txtSQL2 = " DateAlarm Between #" & format(DTPicker1, "yyyy-mm-dd") & " 00:00:00# and #" & format(DTPicker2, "yyyy-mm-dd") & " 23:59:59#"  
      

  5.   

    txtSQL2=" DateAlarm Between #"& format(DTPicker1,"yyyy-mm-dd")&"# and #"& format(DTPicker2,"yyyy-mm-dd")&"#"