where datefield like '" & Text1.Text & "%'"

解决方案 »

  1.   

    where datefield like #" & Cdate(Text1.Text) & "%#"
      

  2.   

    where datefield >=format("03-2-27","yyyy-mm-dd 00:00:00") AND datefield<=format("03-2-27","yyyy-mm-dd 23:59:59")
      

  3.   

    where Cdate('03-2-27 10:20:25')='"&text1.text&"'"
      

  4.   

    to Girl1983(长发女生):
    你用的"#"是什么意思???
      

  5.   

    wuzhiliang(枕着雨声入眠) AND hengxin54(火星)
    Cdate()是什么函数啊???
    format()又是什么意思啊??怎么用啊
    小弟请教
      

  6.   

    strSql="select ... where datefield between '" & text1 & "' 00:00:00' AND '" & text1 & "' 23:59:59' "
      

  7.   

    精确的查询
    text="03-02-27"
    strSql="select ... where year(getdate())=" & Format(Text, "yyyy") & _
    " and month(getdate())=" & Format(Text, "mm") & _
    " and day(getdate())=" & Format(Text, "dd")
      

  8.   

    getdate() 是我举的例子,
    要换成具体的日期字段名
      

  9.   

    例如text="03-02-27"就是你要查的日期,
    DateField是你的日期字段名。
    where子句分别吧对应的年月日匹配,
    查出的就是你要的日期的结果!
    strSql="select ... where year(DateField)=" & Format(Text, "yyyy") & _
    " and month(DateField)=" & Format(Text, "mm") & _
    " and day(DateField)=" & Format(Text, "dd")
      

  10.   

    format :数据格式化函数,MSDN有,去看看CDate:把日期型字符串转换成日期型数据 MSDN有,去看看