存货收发存汇总表打开报错
金蝶云社区-tengzxd
tengzxd
0人赞赏了该文章 1,132次浏览 未经作者许可,禁止转载编辑于2017年03月29日 19:23:22

版本:V6.1
问题:打开存货收发存汇总表报错“查询出现异常。列名 'FMODEL' 不明确。”

SELECT T.FMATERIALBASEID,T.FMATERIALID,FMATERIALNAME,GROUPL.FNAME FMATERIALGROUP,FMODEL, FLOTNO, FASSIPROPERTYID,ENUML.FCAPTION FMATERPROPERTY,MT.FNAME FMATERTYPE, BOM.FNUMBER FBOMNO,FPLANNO,FSEQUENCENO,FPROJECTNO,FOWNERID,OWN.FNAME FOWNERNAME,FSTOCKORGID,SORG.FNAME FSTOCKORGNAME,T.FSTOCKID,STOCK.FNAME FSTOCKNAME, FSTOCKPLACEID,FSTOCKPLACENAME,RANG.FNUMBER FACCTGRANGEID,RANGL.FNAME FACCTGRANGENAME,UNITL.FNAME FUNITNAME,t.FUnitID , FINITQTY,FINITPRICE, FINITAMOUNT,FRECEIVEQTY, FRECEIVEPRICE, FRECEIVEAMOUNT,FSENDQTY, FSENDPRICE, FSENDAMOUNT,FENDQTY,FENDPRICE, FENDAMOUNT, t.FSTOCKSTATUSID,sts.FNAME FSTOCKSTATUSNAME,FDIMID,FDIMID as FAcctgDimID,FASSIPROPNAME,2 as FDIGITS, 6 as FPRICEDIGITS,unit.FPRECISION as FQtyDigits,ENUML1.FCAPTION FVALUATION,FIsTotal,FGroupByFIeld,FDetailBillFormId FDetailReportFormId, ROW_NUMBER() OVER(ORDER BY T.FMATERIALID asc ,T.FDIMID asc,T.FISTOTAL desc ) FIDENTITYID into TMP4A6A5F9E147111E78656000C29C from #TM_HS_StockInSummaryData T left join T_BD_STOCKSTATUS_L sts on t.FSTOCKSTATUSID = sts.FSTOCKSTATUSID and sts.FLOCALEID=2052 left join T_BD_UNIT unit on unit.funitid = t.FUnitID left join T_HS_ACCTGRANGE RANG on T.FACCTGRANGEID = RANG.FACCTGRANGEID left join T_ORG_ORGANIZATIONS_L SORG on T.FSTOCKORGID = SORG.FORGID and SORG.FLOCALEID = 2052 left join T_ORG_ORGANIZATIONS_L OWN on T.FOWNERID = OWN.FORGID and OWN.FLOCALEID = 2052 left join t_BD_Stock_L STOCK on T.FSTOCKID = STOCK.FSTOCKID and STOCK.FLOCALEID = 2052 left join T_HS_ACCTGRANGE_L RANGL on T.FACCTGRANGEID = RANGL.FACCTGRANGEID and RANGL.FLOCALEID = 2052 left join T_BD_UNIT_L UNITL on T.FUNITID = UNITL.FUNITID and UNITL.FLOCALEID = 2052 left join T_BD_MATERIALCATEGORY_L MT on T.FMATERTYPE = MT.FCATEGORYID and MT.FLOCALEID = 2052 left join t_eng_bom BOM on BOM.FID = T.FBOMNO left join T_META_FORMENUMITEM ENUM on ENUM.FID = 'ac14913e-bd72-416d-a50b-2c7432bbff63' and ENUM.FVALUE = T.FMATERPROPERTY left join T_META_FORMENUMITEM_L ENUML on ENUM.FENUMID = ENUML.FENUMID and ENUML.FLOCALEID = 2052 left join T_META_FORMENUMITEM ENUM1 on ENUM1.FID = 'eca675f6-d296-4ba9-b9df-170b7b286a73' and ENUM1.FValue = t.FVALUATION left join T_META_FORMENUMITEM_L ENUML1 on ENUM1.FENUMID = ENUML1.FENUMID and ENUML1.FLOCALEID = 2052 left join t_bd_Material MAT ON T.FMATERIALBASEID = MAT.FMATERIALID left join T_BD_MATERIALGROUP_L GROUPL ON MAT.FMATERIALGROUP=GROUPL.FID AND GROUPL.FLOCALEID= 2052 where 1 = 1
update TMP4A6A5F9E147111E78656000C29C set FQtyDigits=(select max(unit.FPRECISION) from #TM_HS_StockInSummaryData t left join T_BD_UNIT unit on unit.funitid = t.FUnitID where t.FISTOTAL=0 ), FMATERIALID=FMATERIALID||N'-总计' where FISTOTAL = 3