select FBILLNO 单据编号 ,MFNUMBER 物料编码,MFNAME 物料名称,SRCFNAME 调出仓库,PSONO 调出仓位,FQTY 调出数量,FNAME 单位,DESFNAME 调入仓库,FPRINTTIMES 打印次数,FPRINTDATETIME 打印时间,FDATE 日期,FNOTE 表单备注 ,EFNOTE 明细备注
from
(select
tss.FBILLNO , tssE.FMATERIALID ,tbm.FNUMBER MFNUMBER, tbm_L.FNAME MFNAME,tssE.FSRCSTOCKID ,tbs.FNUMBER SRCFNUMBER , tbs_L.FNAME SRCFNAME,
tssE.FSRCSTOCKLOCID ,tbf1_L.FNAME +'.'+tbf2_L.FNAME+'.'+tbf3_L.FNAME +'.'+tbf4_L.FNAME PSONO,tsse.FUNITID ,tbu_L.FNAME ,tsse.FQTY ,tsse.FDESTSTOCKID ,tbso.FNUMBER ,tbso_L.FNAME DESFNAME,tss.FNOTE FNOTE , tss.FPRINTTIMES ,tss.FPRINTDATETIME ,tss.FDATE, tsse.FNOTE EFNOTE,tbf.FF100001 ,tbf.FF100002 ,tbf.FF100003,tbf.FF100004 from T_STK_STKTRANSFEROUT tss
left outer join T_STK_STKTRANSFEROUTENTRY tssE on tss.FID =tsse.FID
left outer join T_BD_STOCK tbs on tsse.FSRCSTOCKID =tbs.FSTOCKID
left outer join T_BD_STOCK_L tbs_L on tbs.FSTOCKID =tbs_L.FSTOCKID
left outer join T_BD_STOCK tbso on tsse.FDESTSTOCKID =tbso.FSTOCKID
left outer join T_BD_STOCK_L tbso_L on tbso.FSTOCKID =tbso_L.FSTOCKID
left outer join T_BAS_FLEXVALUESDETAIL tbf on tsse.FSRCSTOCKLOCID =tbf.FID
left outer join T_BD_MATERIAL_L tbm_L on tsse.FMATERIALID =tbm_L.FMATERIALID
left outer join T_BD_MATERIAL tbm on tsse.FMATERIALID =tbm.FMATERIALID
left outer join T_BD_UNIT_L tbu_L on tsse.FUNITID =tbu_L.FUNITID
left outer join T_BAS_FLEXVALUESENTRY_L tbf1_L on tbf.FF100001 =tbf1_L.FENTRYID
left outer join T_BAS_FLEXVALUESENTRY_L tbf2_L on tbf.FF100002 =tbf2_L.FENTRYID
left outer join T_BAS_FLEXVALUESENTRY_L tbf3_L on tbf.FF100003 =tbf3_L.FENTRYID
left outer join T_BAS_FLEXVALUESENTRY_L tbf4_L on tbf.FF100004 =tbf4_L.FENTRYID
where tss.FDOCUMENTSTATUS ='C' and tss.FCANCELSTATUS ='A'
) t
order by t.FBILLNO,t.SRCFNUMBER,t.FF100001 ,t.FF100002 ,t.FF100003,t.FF100004 ASC
在sql server 中运行没错,但是在sql报表中通过,运行时报错
怎么修改sql语句
推荐阅读