下面这句话,比较出现问题:操作符丢失!
tmpstr = "select * from cc where jdate > =" & trim(MInvDate) & " and jdate<=" & trim(MInvDate1)
这其中 jdate 是一个字段名字,而MInvDate和MInvDate1是两个文本框,里面显示的是日期:例如:2004-8-20
其中jdate是文本型
  大家帮帮忙!

解决方案 »

  1.   

    tmpstr = "select * from cc where cast(jdate as datetime) between '" & trim(MInvDate) & "' and '" & trim(MInvDate1) & "'"
      

  2.   

    convert
    cast
    就是轉換一下字符類型﹗
      

  3.   

    strsql="select * from CC where jdate between 时间1 and 时间2"
      

  4.   

    tmpstr = "select * from cc where jdate > ='" & trim(MInvDate) & "' and jdate<='" & trim(MInvDate1) & "'"
    jdate 是char型吗?那这样保证好用,我一向都这样用的
      

  5.   

    access2000
    tmpstr = "select * from cc where jdate > =#" & trim(MInvDate) & "# and jdate<=#" & trim(MInvDate1) & "#"sql server2000
    tmpstr = "select * from cc where jdate > ='" & trim(MInvDate) & "' and jdate<='" & trim(MInvDate1) & "'"
      

  6.   

    select * from cc where jdate > ='2004-08-21' and jdate<='2004-08-21'这是debug的结果。
      但是这个语句放在数据库中,却不能执行:数据库丢失。
     顺便说一句:我的数据库是ACCESS。
      

  7.   

    select * from cc where jdate > = #2004-08-21# and jdate <=#2004-08-21#也不能执行这是为什么?
      

  8.   

    试试这个:
       select * from cc where convert(vchar(10),jdate,120)>='2004-08-21' and convert(vchar(10),jdate,120)<='2004-08-21'
    应该可以的。