Análisisde Ventas con股票

2020-09-14 02:16发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中) 1。 布宜诺斯艾利斯; ...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


1。 布宜诺斯艾利斯;

在无条件的情况下解决问题,并在查询错误的情况下使用普通的查询方式进行交谈。 Queria probarese Query y ver me me sirve para un tema que tengo pendiente

la Consulta es la siguiente

 DECLARE @VAR INT,@ INI DATETIME,@ FIN DATETIME
 SET @ VAR =(从" [%0]"和" [%1]"之间在A.RefDate的JDT1中选择顶部1 A.TransId)
 SET @INI ='[%0]'
 SET @FIN ='[%1]'
 
 选择T0。[ItemCode],T0。[ItemName],
 ISNULL((从OINM Y那里Y.ItemCode = T0.ItemCode AND Y.DocDate <@INI)的SELECT(SUM(Y.InQty)-SUM(Y.OutQty)),0)'库存一个购物车',
 ISNULL((从OINM Y WHERY Y.ItemCode = T0.ItemCode AND Y.DocDate <= @FIN)中选择(SELECT(SUM(Y.InQty)-SUM(Y.OutQty)),0)'库存一个总站',
 ISNULL((从OINM Y WHERE Y.ItemCode = T0.ItemCode AND Y.DocDate <= @FIN中选择SELECT SUM(TransValue),0)'股票Valorizado',
 ISNULL((从OINV X内连接INV1中选择SUM(Y.Quantity)Y ON Y.DocEntry = X.DocEntry WHERE Y.ItemCode = T0.ItemCode AND X.DocDate> = @ INI和X.DocDate <= @ FIN)  ,0)-ISNULL((从ORIN X内连接RIN1中选择SELECT SUM(Y.Quantity)在Y.DocEntry = X.DocEntry上Y.ItemCode = T0.ItemCode和X.DocDate> = @ INI和X.DocDate <  = @ FIN),0)'广告文迪达',
 DATEDIFF(dd,@INI,@FIN)'Nºde dias segun fechas',
 案件
 当ISNULL((从OINV X内联接INV1中选择SUM(Y.Quantity)时Y ON Y.DocEntry = X.DocEntry WHERE Y.ItemCode = T0.ItemCode和X.DocDate> = @ INI和X.DocDate <= @ FIN  ),0)-ISNULL((从ORIN X内部联接RIN1中选择SELECT SUM(Y.Quantity)Y ON Y.DocEntry = X.DocEntry其中Y.ItemCode = T0.ItemCode AND X.DocDate> = @ INI和X.DocDate  <= @ FIN),0)<= 0然后0
 ELSE((ISNULL(([SELECT SUM(Y.Quantity)from OINV X INNER JOIN INV1 Y ON Y.DocEntry = X.DocEntry WHERE Y.ItemCode = T0.ItemCode AND X.DocDate> = @ INI和X.DocDate <=  @FIN),0)-ISNULL((从ORIN X内部联接RIN1中选择SELECT SUM(Y.Quantity)Y ON Y.DocEntry = X.DocEntry其中Y.ItemCode = T0.ItemCode和X.DocDate> = @ INI和X  .DocDate <= @ FIN),0))/(DATEDIFF(dd,@INI,@FIN)))
 END'Venta diaria',
 案件
 当ISNULL((SELECT(SUM(Y.InQty)-SUM(Y.OutQty))from OINM Y WHERY Y.ItemCode = T0.ItemCode AND Y.DocDate <= @FIN),0)<= 0然后0
 ELSE((ISNULL((SELECT(SUM(Y.InQty)-SUM(Y.OutQty))from OINM Y WHERE Y.ItemCode = T0.ItemCode AND Y.DocDate <= @FIN),0)/(((((  ((从OINV X内连接INV1中选择SELECT SUM(Y.Quantity)Y ON Y.DocEntry = X.DocEntry WHERE Y.ItemCode = T0.ItemCode AND X.DocDate> = @ INI和X.DocDate <= @ FIN),  0)-ISNULL((从ORIN X内连接RIN1中选择SUM(Y.Quantity),在Y.DocEntry = X.DocEntry上Y.ItemCode = T0.ItemCode和X.DocDate> = @ INI和X.DocDate <=  @FIN),0))/(DATEDIFF(dd,@INI,@FIN)))))))
 END'Venta futura',
 ISNULL((SELECT SUM(Y.Quantity * Y.Price)FROM OINV X INNER JOIN INV1 Y ON Y.DocEntry = X.DocEntry其中Y.ItemCode = T0.ItemCode和X.DocDate> = @ INI和X.DocDate <  = @ FIN),0)-ISNULL((从ORIN X内部联接RIN1中选择SELECT SUM(Y.Quantity * Y.Price)Y ON Y.DocEntry = X.DocEntry WHERE Y.ItemCode = T0.ItemCode AND X.DocDate>  = @ INI和X.DocDate <= @ FIN),0)'Ventas',
 ISNULL((SELECT SUM(Y.Quantity * Y.Price)-SUM(Y.Quantity * Y.GrossBuyPr)FROM OINV Z INNER JOIN INV1 Y ON Y.DocEntry = Z.DocEntry其中Z.DocDate在@INI和@FIN之间 AND Y.ItemCode = T0.ItemCode),0)-ISNULL((SELECT SUM(Y.Quantity * Y.Price)-SUM(Y.Quantity * Y.GrossBuyPr)FROM ORIN Z INNER JOIN RIN1 Y ON Y.DocEntry =  Z.DocEntry在@INI和@FIN与Y.ItemCode = T0.ItemCode之间的Z.DocDate),0)'Ganancia bruta',
 ((ISNULL((SELECT SUM(Y.Quantity * Y.Price)-SUM(Y.Quantity * Y.GrossBuyPr)FROM OINV Z INNER JOIN INV1 Y ON Y.DocEntry = Z.DocEntry其中Z.DocDate在@INI和之间 @FIN AND Y.ItemCode = T0.ItemCode),0)-ISNULL((SELECT SUM(Y.Quantity * Y.Price)-SUM(Y.Quantity * Y.GrossBuyPr)from ORIN Z INNER JOIN RIN1 Y ON Y.  DocEntry = Z.DocEntry @INI和@FIN与Y.ItemCode = T0.ItemCode),0)之间的Z.DocDate)/(ISNULL((从OINV X INNER JOIN INV1中选择SUM(Y.Quantity * Y.Price)  Y ON Y.DocEntry = X.DocEntry其中Y.ItemCode = T0.ItemCode和X.DocDate> = @ INI和X.DocDate <= @ FIN),0)-ISNULL((SELECT SUM(Y.Quantity * Y。 价格)从ORIN X内部联接RIN1 Y在Y.DocEntry = X.DocEntry上Y.ItemCode = T0.ItemCode和X.DocDate> = @ INI和X.DocDate <= @ FIN),0))))* 100'  %Ganancia'
 从OITM T0
/* ISNULL((SELECT(SUM(Y.InQty)-SUM(Y.OutQty))from OINM Y WHERE Y.ItemCode = T2.ItemCode AND Y.DocDate <='[%1]'),0)!  = 0 AND */
 
 ISNULL((从OINV X内联接INV1中选择SELECT SUM(Y.Quantity * Y.Price)Y ON Y.DocEntry = X.DocEntry W.E Y.ItemCode = T0.ItemCode AND X.DocDate <='[%0]')  ,0)-ISNULL((从ORIN X内部联接RIN1中选择SELECT SUM(Y.Quantity * Y.Price)Y ON Y.DocEntry = X.DocEntry其中Y.ItemCode = T0.ItemCode和X.DocDate <='[%  0]'),0)!= 0
 
 ORDER BY T0。[ItemCode]
 

我属siguiente错误:

从字符串转换日期和/或时间时,消息241,级别16,状态1,第2行转换失败。

Agradeceria mucho la ayuda en este asunto

slds。