<%
bj_sum="(select sum(jj_hejia) from cx_jijia_mx where year(jj_date) ='" & year_ & "' and DatePart(q,jj_date) ='" & quarter_ & "' ) as bj_sum"
bn_sum="(select sum(jj_hejia) from cx_jijia_mx where year(jj_date) ='" & year_ & "' and DatePart(q,jj_date)<='" & quarter_ & "') as bn_sum"
j_sum="(select sum(jj_hejia) from cx_jijia_mx where ((year(jj_date) ='" & year_ & "' and DatePart(q,jj_date)<='" & quarter_ & "') or (year(jj_date) <'" & year_ & "'))) as lj_sum"
set rs2=conn.execute("select "&bj_sum&","&bn_sum&","&lj_sum&" from cx_jijia_mx where jj_biaoduan='"&biaoduan&"' "&tiaojian&"")
if rs2.eof and rs2.bof then
page=1
pages=1
totaluser=0
response.write" 【对不起,没有查询到您要的数据!】 "
else
bj_sum=rs2(0)
bn_sum=rs2(1)
lj_sum=rs2(2)
end if
%>
<tr bgcolor="#FFFFFF" >
<td align="right" height="20" style ="word-break:break-all" bgcolor="#D6D3D3"><%=bj_sum%></td>
<td align="right" height="20" style ="word-break:break-all" bgcolor="#D6D3D3"><%=bn_sum%></td>
<td align="right" height="20" style ="word-break:break-all" bgcolor="#D6D3D3"><%=lj_sum%></td>
</tr>
存在问题:在家里测试都是好好的,换了一台计算机再试。输出的bj_sum,bn_sum,lj_sum的值非常大,大的很不正常。我不知是为什么。环境 :XP+SQL2000
------解决方案--------------------
数据都不一样吧。。自己检查下数据库的数据
------解决方案--------------------
把 sql语句 response.write 出来看看是否一样,一样的话,再到数据库环境下执行看看结果。
------解决方案--------------------
+1
这是一种好方法。打印出来自己分析一下。一般很快就找到问题所在的了。