把 having count(CarNumber) > 2
改成 having count(*) > 2 试试。

解决方案 »

  1.   

    qryList.SQL.Add('select CarNumber,Count(*) as OverTimes from ggjzcinfo where TreatSign=0 group by CarNumber having count(CarNumber) > 2 ')
    后面没有分号?
      

  2.   

    是我犯低级错误
    open时触发另一个事件,那个事件的sql有问题。
    数据库里存放日期字段,格式为23-8月-05,在where 里我传过去的日期格式为2005-8-23它不认,oracle有什么函数转一下吗