string strSQL = "";
if (Convert.ToInt16(Session["Z001"]) == 1)
{
strSQL = "select b.unit,sum(" + strField + ") from stat" + Session["JCNO"].ToString() + " a,areacode b,stat0 c where substr(a.areacode,0,4)=substr(b.code,0,4) and a.z000=c.z000 and a.ny=c.ny and c.qysbsj is not null and b.z001=2 and a.ny='" + Session["Ny"].ToString() + "' group by substr(a.areacode,0,4),b.unit order by substr(a.areacode,0,4)";
}
else if (Convert.ToInt16(Session["Z001"]) == 2)
{
strSQL = "select b.unit,sum(" + strField + ") from stat" + Session["JCNO"].ToString() + " a,areacode b,stat0 c where substr(a.areacode,0,6)=substr(b.code,0,6) and a.z000=c.z000 and a.ny=c.ny and c.qysbsj is not null and b.z001 in(3,4,5,6) and left(a.z000,4)='" + Session["Z000"].ToString().Substring(0, 4) + "' and a.ny='" + Session["Ny"].ToString() + "' group by substr(a.areacode,0,6),b.unit order by substr(a.areacode,0,6)";
}