fayevalentine
Programmer
Hi!
I have a few problems about a stored procedure.
I would thanks all help possible.
Im trying to get the sum of all elements of a column but a get this error:
"Eror 170:Incorrect sintax near ="
This is my code:
CREATE PROCEDURE dbo.Moon
@pintOrderId INT,
@pcurTotal MONEY OUTPUT
AS
SELECT ord.OrderID,
ord.ProductID,
pro.ProductName,
ord.UnitPrice,
ord.Quantity,
Total = ord.UnitPrice * ord.Quantity
-- suma = SUM (ord.UnitPrice * ord.Quantity)
FROM [Order Details] ord LEFT JOIN Products pro ON pro.ProductID LIKE ord.ProductID
WHERE ord.OrderID = @pintOrderId
GROUP BY ord.OrderID,
ord.ProductID,
pro.ProductName,
ord.UnitPrice,
ord.Quantity
SET suma = COMPUTE SUM ( ord.UnitPrice * ord.Quantity )
GO
I have a few problems about a stored procedure.
I would thanks all help possible.
Im trying to get the sum of all elements of a column but a get this error:
"Eror 170:Incorrect sintax near ="
This is my code:
CREATE PROCEDURE dbo.Moon
@pintOrderId INT,
@pcurTotal MONEY OUTPUT
AS
SELECT ord.OrderID,
ord.ProductID,
pro.ProductName,
ord.UnitPrice,
ord.Quantity,
Total = ord.UnitPrice * ord.Quantity
-- suma = SUM (ord.UnitPrice * ord.Quantity)
FROM [Order Details] ord LEFT JOIN Products pro ON pro.ProductID LIKE ord.ProductID
WHERE ord.OrderID = @pintOrderId
GROUP BY ord.OrderID,
ord.ProductID,
pro.ProductName,
ord.UnitPrice,
ord.Quantity
SET suma = COMPUTE SUM ( ord.UnitPrice * ord.Quantity )
GO