Sql 即时库存查询带仓位方法
122人赞赏了该文章
1,253次浏览
编辑于2024年03月23日 15:57:10
Select * From(
Select
ORG.FNAME as 库存组织,
T2.FNUMBER as 物料编码,
T3.FNAME as 物料名称,
T3.FSPECIFICATION as 规格型号,
T6.FNAME as 单位,
Convert(decimal (23,4),T1.FBASEQTY) as 可用库存,
T8.FNAME as 仓位名称,
T9.FNUMBER as 仓位编码,
T4.FNAME as 所在仓库,
T5.FNUMBER as 批号
From T_STK_INVENTORY T1
Inner Join T_ORG_Organizations_L ORG ON T1.FSTOCKORGID=ORG.FORGID
Inner Join T_BD_MATERIAL T2 ON T1.FMATERIALID=T2.FMATERIALID
Inner Join T_BD_MATERIAL_L T3 ON T1.FMATERIALID=T3.FMATERIALID
Inner Join T_BD_STOCK_L T4 ON T4.FSTOCKID=T1.FSTOCKID
Inner Join T_BD_LOTMASTER T5 ON T1.FLOT=T5.FLOTID
Inner Join T_BD_UNIT_L T6 ON T1.FBASEUNITID=T6.FUNITID And T6.FLOCALEID=2052
Left Join T_BAS_FLEXVALUESDETAIL T7 ON T7.FID=T1.FSTOCKLOCID--仓位关联ID
Left Join T_BAS_FLEXVALUESENTRY_L T8 ON T8.FENTRYID=T7.FF100001--关联仓位名称
Left Join T_BAS_FLEXVALUESENTRY T9 ON T9.FENTRYID=T7.FF100001--关联仓位编码
Where T1.FBASEQTY !=0 --可用库存不等于0
) List Where 物料编码='物料编码'
温馨提示:如果你的系统升级到了8.2,是可以直接使用查询Sql语法发布为报表,如果提示返回数据太多,可以 Select top 1000 * from(Select * from XXX)List 嵌套查询包裹一下,就可以成功生成Sql自定义报表!
记住,必须是8.2以上版本!
WebApi 仓位查询写法
即时库存.zip(0.70KB)
本文转载自:https://vip.kingdee.com/questions/92943/answers/97701?productLineId=1&isKnowledge=2&lang=zh-CN
作者:Kingdee官方知识
原文链接:https://vip.kingdee.com/questions/92943/answers/97701?productLineId=1&isKnowledge=2&lang=zh-CN
赞 122
122人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!