zhw48253561 发表于 2018-5-25 13:36:13

报表配置sql语句拼接有问题

参考自带的 用户操作统计,截取的sql语句如下(数据库用 sql server 2005)
SELECT t.* FROM ( select a.userid, count(*) ct, sum(case when right(logcontent, 4) in ('登录成功', 'cess')
then 1 else 0 end) login_count from t_s_log a where operatetime >= (CONVERT(VARCHAR,'2018-05-01') as
DATETIME) AND operatetime <= (CONVERT(VARCHAR,'2018-05-25') as DATETIME) group by a.userid )
torder by ct desc

admin 发表于 2018-5-27 21:44:35

页: [1]
查看完整版本: 报表配置sql语句拼接有问题