点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨, 我们正在使用SAP B1...
点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨, 我们正在使用SAP B1...
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
嗨,
我们正在使用SAP B1,MS SQL 2012
有人帮助我生成以下格式的每日,每月,每年的销售分析报告。 来自应收发票
谢谢。
文档类型发票/贷记凭证
月明智销售---------- >>>>>>
选择T0.ITEMCODE作为" AZ代码",T0。[CodeBars],T2.ItmsGrpNam作为"家族",T0.ItemName,T0.OnHand作为" AZ库存",(从中选择SUM(T1.QUANTITY) 带有(NOLOCK)的INV1 T1,其中T1.ITEMCODE = T0.ITEMCODE和YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'YTD',(从带有(NOLOCK)的INV1 T1中选择SUM(T1.QUANTITY) )MONTH(T1.DOCDATE)= 1和T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'JAN',(从INV1中选择SUM(T1.QUANTITY) T1的(NOLOCK)MONTH(T1.DOCDATE)= 2并且T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'FEB',(SELECT SUM(T1。 (INLOCK)的INV1 T1中的数量(MONTH(T1.DOCDATE)= 3和T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'MAR',(SELECT 来自INV1 T1的SUM(T1.QUANTITY),其中(NOLOCK)MONTH(T1.DOCDATE)= 4和T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'APR ',(在(NOLOCK)WHERE MONTH(T1.DOCDATE)= 5 AND T1.ITEMCODE的情况下从INV1 T1中选择SELECT SUM(T1.QUANTITY) = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'MAY',从(INLOCK)WHERE MONTH(T1.DOCDATE)= 6的INV1 T1中选择(SELECT SUM(T1.QUANTITY) AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'JUN',(从(#)在(#)的(#)中选择(NOLOCK)WHERE MONTH(T1。 DOCDATE)= 7 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'JUL',(在(NOLOCK)位置从INV1 T1中选择SUM(T1.QUANTITY) MONTH(T1.DOCDATE)= 8 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'AUG',(从INV1 T1中选择SUM(T1.QUANTITY) (NOLOCK)MONTH(T1.DOCDATE)= 9 AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'SEP',(SELECT SUM(T1.QUANTITY) 从INV1 T1(其中(NOLOCK))MONTH(T1.DOCDATE)= 10且T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)为'OCT',(SELECT SUM( INV1 T1中的(T1.QUANTITY)(NOLOCK)月(T1.DOCDATE)= 11并且T1.ITEMCODE = T0.ITEMCODE和YE AR(T1.DOCDATE)= YEAR(GETDATE())-0)为'NOV',从(INLOCK)从INV1 T1选择SUM(T1.QUANTITY),其中(MONTH)(T1.DOCDATE)= 12并且T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE)= YEAR(GETDATE())-0)从dbo.OITM T0左联接dbo.INV1 T1到T1.ItemCode = T0.ItemCode内联接OITB T2在T0上为'DEC'。 [ItmsGrpCod] = T2。[ItmsGrpCod]按T0.ItemCode,T2.ItmsGrpNam,T0。[CodeBars],T0.Itemname,T0.OnHand,YEAR(T1.DOCDATE)分组,年份(T1.DOCDATE)=年(GETDATE) ())-0 ORDER BY T0。 项目代码
一周热门 更多>