在信息层中我想要创建一个数据集,用到数据库的两张表,我把在SQL查询分析器中运行通过的SQL拷贝到数据集的“SQL命令编辑器”中,保存竟然提示出错,不知道为什么,难道不支持自己写的SQL语句么?
SQL已在分析器中允许无误,如下:
select COUNTRYCODE.NAME AS 国家地区,
case when(YEAR(FP.IDATE) = 2006) then sum(FP.USD)/10000 else 0 end as 累计金额,
case when(YEAR(FP.IDATE)=2006-1) then sum(FP.USD)/10000 else 0 end as 上年同期
FROM FP, COUNTRYCODE
WHERE
SubString(FP.MYGM, 1, 1) = COUNTRYCODE.CUSTOMCODE and COUNTRYCODE.CODELEVEL = 2
and COUNTRYCODE.OVERSEAS = 1 and FP.INVICETYPE <> '投标业务' and FP.INVICETYPE <> '国内贸易'
and FP.INVICETYPE <> '招标业务' and FP.EMPLOYEEID is not null and FP.EMPLOYEEID <> ''
and (Year(FP.IDATE)= 2006 or Year(FP.IDATE)= 2006-1 )
GROUP BY COUNTRYCODE.NAME,COUNTRYCODE.CODE,FP.IDATE |