次数最多数据查询显示问题

下面需要查询显示出次数最多的项目,不知道问题在哪里?

"本周<font color='blue'>进行了" + sql("jiaoxei", "select count(检查项目) 检查次数合计 from dbo.班级考核 where convert(varchar(10),检查时间,23) between '" + dateinweek(today(), 1) + "' and '" + today() + "'", 1, 1) + "次评价,<font color='blue'>" + "这些评价涉及了<font color='blue'>" + sql("jiaoxei", "select distinct 检查项目 from dbo.班级考核 where convert(varchar(10),检查时间,23) between'" + dateinweek(today(), 1) + "' and '" + today() + "'", 1, 1) + "。评价次数最多的指标为【<font color='blue'>" + sql("jiaoxei," select top 1 * from (select top 1 * from (select 检查项目,count(*) as 次数 from dbo.班级考核 

 where convert(varchar(10),检查时间,23) between '" + dateinweek(today(), 1) + "' and '" + today() + "' group by 检查项目)t order by 次数 desc  1, 1 ) + "】<font color='blue'>"



FineReport nxwzqy1 发布于 2020-3-31 17:04
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
1
axingLv6专家互助
发布于2020-3-31 17:11

上面少了双引号

下面不要使用回车换行

"本周<font color='blue'>进行了" + sql("jiaoxei", "select count(检查项目) 检查次数合计 from dbo.班级考核 where convert(varchar(10),检查时间,23) between '" + dateinweek(today(), 1) + "' and '" + today() + "'", 1, 1) + "次评价,<font color='blue'>" + "这些评价涉及了<font color='blue'>" + sql("jiaoxei", "select distinct 检查项目 from dbo.班级考核 where convert(varchar(10),检查时间,23) between'" + dateinweek(today(), 1) + "' and '" + today() + "'", 1, 1) + "。评价次数最多的指标为【<font color='blue'>" + sql("jiaoxei","select top 1 * from (select top 1 * from (select 检查项目,count(*) as 次数 from dbo.班级考核 where convert(varchar(10),检查时间,23) between '" + dateinweek(today(), 1) + "' and '" + today() + "' group by 检查项目)t order by 次数 desc",1, 1) +"】<font color='blue'>"

image.png

  • 2关注人数
  • 271浏览人数
  • 最后回答于:2020-3-31 17:11
    请选择关闭问题的原因
    确定 取消
    返回顶部