问错了,也就是说VB中SQL语句怎样写?

解决方案 »

  1.   

    strSql = "select * from people where datefrom=" & "'" & CDate(Text1(0).Text) & "' and dateto='" & CDate(Text1(1).Text) & "'"
      

  2.   

    Select * from Table where Datefrom=#日期# and Dateto=#日期#
      

  3.   

    select * from table where DATEFROM<#DateTime# and DATETo>#DateTime#
      

  4.   

    给不出分啊:(me.print err.description
    显示这个:(
    贴子回复次数大于跟给分次数 
      

  5.   

    还有啊,我数据库中明明有12条02-07-01 的记录为什么用这样一条语句确不能找出来呢?strSql = "select * from people where datefrom=" & "#" & CStr(CDate(Text1(0).Text)) & "# and dateto=#" & CStr(CDate(Text1(1).Text)) & "#"痛苦死了:(
      

  6.   

    你debug的时候把strsql考出来到ACCESS中直接执行看看。
    我估计是要比大小,而不是直接等于的。
      

  7.   

    你用convert把日期转换成统一的格式,比较起来会准确一些