你用过吗?
   我用format试过,不好用,我把他转成string也不行,你是怎么做的,能写的具体些吗?

解决方案 »

  1.   

    你用的sql语句提示什么错误啊?
      

  2.   

    strsql = "select * from xtrz where  cdate(czsj) >= '" & dfrom & "'"
    应该可以的
      

  3.   

    但是就是不对啊,cdate(czsj)转换后就剩00:00:00了,年月日都没有了,
    我不知道还能怎样转换,string我也试过了。你的程序这样写就没有问题吗?
      

  4.   

    用Datediff对两个日期做差,判断结果!strsql="select * from xtrz where datediff('d',cdate(czsj)," & dfrom & ")<0"
      

  5.   

    …………
    where datediff('d',cdate(czsj)," & dfrom & ")<10 and datediff('d',cdate(czsj)," & dfrom & ")>0"