ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select cline_name,'成团次数'=count(cline_name),'报名人数'=sum(cAlready_sign) from T_Group_Info where dLeave_date>='+'+dtp1.date+'+'and dLeave_date=<'+'+dtp2.date+'+'+Group by cline_name');
ADOQuery1.Open;
不知道是什么地方错了。。帮帮我吧

解决方案 »

  1.   

    ADOQuery1.SQL.Add('select cline_name, count(cline_name) as 成团次数, sum(cAlready_sign) as 报名人数 from T_Group_Info where dLeave_date >= ''' + dtp1.date + ''' and dLeave_date <= ''' + dtp2.date + ''' Group by cline_name');
      

  2.   

    ADOQuery1.SQL.Add('select cline_name, count(cline_name) as 成团次数, sum(cAlready_sign) as 报名人数 from T_Group_Info where dLeave_date >= ''' + DateToStr(dtp1.date) + ''' and dLeave_date <= ''' + DateToStr(dtp2.date) + ''' Group by cline_name');
      

  3.   

    ADOQuery1.SQL.Add('select cline_name, count(cline_name) as 成团次数, sum(cAlready_sign) as 报名人数 from T_Group_Info where dLeave_date between ''' + DateToStr(dtp1.date) + ''' and ''' + DateToStr(dtp2.date) + ''' Group by cline_name');