SQL查询语句问题,请大家帮忙看一下
我现在有一个表如下user_feiyong(应收) weixiu_feiyong(实收) chuangshou(创收) paodanfei(单费) paidan_name(工程师) keping(客户评价)
如今我想用查询语句将其汇总
目前我已能汇总user_feiyong(应收) weixiu_feiyong(实收) chuangshou(创收) paodanfei(单费)也就是数字类型的汇总已完成,但不能统计客户评价这一栏数量,我要的结果是:
非常满意及比较满意(满意) 不满意 投诉 未联系上
80% 10% 1% 9%
<%
dim xingming,date1,date2
xingming=request("paidan_name")
IF request("baoxiu_date1")<>"" And request("baoxiu_date2")<>"" Then
date1=request("baoxiu_date1")
date2=request("baoxiu_date2")
End IF
IF request("date1")<>"" And request("date2")<>"" Then
date1=request("date1")
date2=request("date2")
End IF
sql="select paidan_name,count(bx_id) as danshu,sum(user_feiyong) as user_feiyong,sum((chuangshou))as chuangshou,sum(weixiu_feiyong) as weixiu_feiyong,sum(paodanfei) as paodanfei from baoxiu where baoxiu_date between #"&date1&"# and #"&DateAdd("d",1,date2)&"# group by paidan_name "
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
[[it] 本帖最后由 qinyun 于 2008-6-8 19:56 编辑 [/it]]