万能报表平台生成的sql报错
金蝶云社区-广西尚贤李勇
广西尚贤李勇
0人赞赏了该文章 1,009次浏览 未经作者许可,禁止转载编辑于2015年03月14日 11:52:03

列名 'FNUMBER_E4' 无效。
**********************************************************************
*******SQL************************************************************
SELECT TOP 1000 E0.F_BAM_DEPT,E0.F_BAM_PRICE,E0.F_BAM_SALEPEOPLE,E0.F_BAM_BASEQTY,E0.F_BAM_AMOUNT,E0.F_BAM_FNAME,E0.F_BAM_QTY,E0.F_BAM_MATERIAL,E1.FID,E1.FNAME,E2.FMATERIALID,E2.FNUMBER,E2.FNAME AS FNAME_E2,E2.FBASE,E2.FMATERIALGROUP,E3.FID AS FID_E3,E3.FNAME AS FNAME_E3,E4.FDEPTID,E4.FNUMBER AS FNUMBER_E4,E4.FNAME AS FNAME_E4
FROM (
SELECT T1.F_BAM_DEPT AS F_BAM_DEPT,T1.F_BAM_PRICE AS F_BAM_PRICE,T1.F_BAM_SALEPEOPLE AS F_BAM_SALEPEOPLE,T1.F_BAM_BASEQTY AS F_BAM_BASEQTY,T1.F_BAM_AMOUNT AS F_BAM_AMOUNT,T1.F_BAM_FNAME AS F_BAM_FNAME,T1.F_BAM_QTY AS F_BAM_QTY,T1.F_BAM_MATERIAL AS F_BAM_MATERIAL
FROM BAM_REPORTENTITY T1 ) E0
INNER JOIN (
SELECT T0.FID AS FID,T0_L.FNAME AS FNAME
FROM T_HR_EMPINFO T0
LEFT JOIN T_HR_EMPINFO_L T0_L ON (T0.FID=T0_L.FID AND T0_L.FLOCALEID=2052) ) E1 ON E0.F_BAM_SALEPEOPLE = E1.FID
INNER JOIN (
SELECT T0.FMATERIALID AS FMATERIALID,T0.FNUMBER AS FNUMBER,T0_L.FNAME AS FNAME,T0.F_BAM_PP AS FBASE,T0.FMATERIALGROUP AS FMATERIALGROUP
FROM T_BD_MATERIAL T0
LEFT JOIN T_BD_MATERIAL_L T0_L ON (T0.FMATERIALID=T0_L.FMATERIALID AND T0_L.FLOCALEID=2052) ) E2 ON E0.F_BAM_MATERIAL = E2.FMATERIALID
INNER JOIN (
SELECT T0.FID AS FID,T0_L.FNAME AS FNAME
FROM T_BAM_PP T0
LEFT JOIN T_BAM_PP_L T0_L ON (T0.FID=T0_L.FID AND T0_L.FLOCALEID=2052) ) E3 ON E2.FBASE = E3.FID
INNER JOIN (
SELECT T0.FDEPTID AS FDEPTID,T0.FNUMBER AS FNUMBER,T0_L.FNAME AS FNAME
FROM T_BD_DEPARTMENT T0
LEFT JOIN T_BD_DEPARTMENT_L T0_L ON (T0.FDEPTID=T0_L.FDEPTID AND T0_L.FLOCALEID=2052) ) E4 ON E0.F_BAM_DEPT = E4.FDEPTID
WHERE ( E4.FNUMBER_E4 LIKE '200.01%' )

WHERE ( E4.FNUMBER_E4 LIKE '200.01%' )是我在数据源过滤里面增加的一个过滤条件,把这个SQL修改为
WHERE ( E4.FNUMBER LIKE '200.01%' )是可以在SQL查询分析器查询的,应该是系统自动生成的字段别名有问题