恩,可以了
非常感谢fcuandy
--------------------------------
还有个问题,
Request.QueryString["w_time"]
传的参数是w_time=2007年05月
怎么在显示列表读出来呢?
即SQL语句怎么写啊?
select * from bk_wz where w_time= '"+Request.QueryString["t_time"]+ "' ORDER BY w_time DESC";
string strSel1 = "select replace(convert(varchar(7),w_time,120),'-','年') + '月' w_time,count(*) num from bk_wz group by select replace(convert(varchar(7),w_time,120),'-','年') + '月' ";
string strSel1 = "select replace(convert(varchar(7),w_time,120),'-','年') + '月' w_time,count(*) num from bk_wz group by convert(varchar(7),w_time,120)";
-----------------------------------------------------
用上面这个语句,出现以下出错:
--------------------------------------------
列 'bk_wz.w_time' 在选择列表中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。
select convert(varchar(7),w_time,120),count(*) from bk_wz group by convert(varchar(7),w_time,120) order by convert(varchar(7),w_time,120)
======================================
使用这个语句,就出现上面的错误。
w_time 这个字段是有的