sql="SELECT c_ip,cnum=SUM(c_count) FROM f_counter_day WHERE c_date="& mydate & " and c_cata = 1 group by c_ip"
set rs=conn.Execute(sql)

解决方案 »

  1.   

    sql="SELECT SUM(c_count) as cnum FROM f_counter_day WHERE c_date="&mydate&" and c_cata = 1 group by c_ip"
      

  2.   

    sql="select cnum from (SELECT cnum=SUM(c_count) FROM f_counter_day group by c_ip)aa where c_date='"& mydate &"'"
      

  3.   


    sql="select sum(a.c_count) as cnum,a.c_ip from ("
    sql=sql & "select c_count,c_ip from f_counter_day where c_date='" & mydate & "') a"sql=sql & " group by a.c_ip
      

  4.   

    各位,我把" & mydate & "换成常数,程序就可运行,估计问题在变量mydate处,我在查查
      

  5.   

    将"&mydate&" 换成 '"&mydate&"'即:sql="SELECT cnum=SUM(c_count) FROM f_counter_day WHERE c_date='"&mydate&"' and c_cata = 1 group by c_ip"
      

  6.   

    sql="SELECT SUM(c_count) cnum FROM f_counter_day WHERE c_date='"&mydate&"' and c_cata=1 group by c_ip"