当GROUP带字段函数时,不行;为什么数据窗口不能编辑GROUP BY呢? 这样的SQL数据窗口怎么创建 ,
当GROUP带字段函数时,不行;为什么数据窗口不能编辑GROUP BY呢? 这样的SQL数据窗口如何创建 ,急啊!!!
SELECT Cstr(year(t_dzshd.shrq))+'-'+Cstr(month(t_dzshd.shrq)) as nian,
t_dzshd.yltypeid,
t_dzshd.mcgg,
sum(iif(isnull(sl),0,sl)) as sumsl,
sum(iif(isnull(je),0,je)) as sumje
FROM t_dzshd
WHERE t_dzshd.flag = 'd'
GROUP BY Cstr(year(t_dzshd.shrq))+'-'+Cstr(month(t_dzshd.shrq)),
t_dzshd.yltypeid,
t_dzshd.mcgg
ORDER BY Cstr(year(t_dzshd.shrq))+'-'+Cstr(month(t_dzshd.shrq)) ASC,
t_dzshd.yltypeid ASC,
t_dzshd.mcgg ASC;
------解决方案--------------------
那你照我第二种方法试一下
------解决方案--------------------
先随便创建DW,再Design - Convert To Syntax 修改sql
SELECT Cstr(year(t_dzshd.shrq))+'-'+Cstr(month(t_dzshd.shrq)) as nian,
t_dzshd.yltypeid,
t_dzshd.mcgg,
sum(iif(isnull(sl),0,sl)) as sumsl,
sum(iif(isnull(je),0,je)) as sumje
FROM t_dzshd
WHERE t_dzshd.flag = 'd'
GROUP BY Cstr(year(t_dzshd.shrq))+'-'+Cstr(month(t_dzshd.shrq)),
t_dzshd.yltypeid,
t_dzshd.mcgg
ORDER BY Cstr(year(t_dzshd.shrq))+'-'+Cstr(month(t_dzshd.shrq)) ASC,
t_dzshd.yltypeid ASC,
t_dzshd.mcgg ASC;
------解决方案--------------------
那你照我第二种方法试一下
------解决方案--------------------
先随便创建DW,再Design - Convert To Syntax 修改sql