Adodc2.RecordSource = "select * from box where 1=1 '" & Trim(ss) & "' and 返回日期 isnull  & and DateDiff('d', '交接日期', today)  &'"<=15"'  
你把这句改成这样试试看

解决方案 »

  1.   

    老兄用的什么数据库,一般sql语句跟用什么数据库有关
      

  2.   

    where 1=1改成where 1=1 and
      

  3.   

    " and DateDiff(day,交接日期,today ) " & "<=15"
      

  4.   

    isnull  & and DateDiff('d', '交接日期', today)  &'"<=15"'  =======>>>>>>>>
    isnull  & and DateDiff('d', '交接日期', today)  &"<='15' "
      

  5.   

    Adodc2.CommandType = adCmdunknown
    label.caption=adodc2.recordcount
    我这样做可以呀
      

  6.   

    “Trim(ss)是对另一个form的条件的引用”,能说的具体点吗?
    因为前面的“where 1=1 ”没有“and”,所以想问问。
    另:想楼上说的试试,改成“Adodc2.CommandType = adCmdunknown”