Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Ayuda con Query

Colegas tengo el siguiente query:

declare @ventas numeric(9,2);

Set @ventas=(SELECT SUM(T3.[LineTotal])

FROM

[dbo].[ORCT] T0 INNER JOIN

[dbo].[RCT2] T1 ON T0.DocNum = T1.DocNum INNER JOIN

[dbo].[OINV] T2 ON T1.DocEntry = T2.DocEntry INNER JOIN

[dbo].[INV1] T3 ON T2.DocEntry = T3.DocEntry INNER JOIN

[dbo].[OSLP] T4 ON T3.SlpCode = T4.SlpCode INNER JOIN

[dbo].[PCH1] T5 ON T3.ItemCode = T5.ItemCode INNER JOIN

[dbo].[@COMISIONES] T6 ON T3.U_Comision = T6.Code

WHERE T0.[DocDate] BETWEEN '[%0]' AND '[%1]' AND T2.[Project] = '[%2]');

Select @ventas as Ventas

FROM

[dbo].[ORCT] T0 INNER JOIN

[dbo].[RCT2] T1 ON T0.DocNum = T1.DocNum INNER JOIN

[dbo].[OINV] T2 ON T1.DocEntry = T2.DocEntry INNER JOIN

[dbo].[INV1] T3 ON T2.DocEntry = T3.DocEntry INNER JOIN

[dbo].[OSLP] T4 ON T3.SlpCode = T4.SlpCode INNER JOIN

[dbo].[PCH1] T5 ON T3.ItemCode = T5.ItemCode INNER JOIN

[dbo].[@COMISIONES] T6 ON T3.U_Comision = T6.Code

WHERE T0.[DocDate] BETWEEN '[%0]' AND '[%1]' AND T2.[Project] = '[%2]'

y me marca un error:

1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Arithmetic overflow error converting numeric to data type numeric.

Alguna sugerencia???

Saludos!

Not what you were looking for? View more on this topic or Ask a question