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