I need help to write a Custom function in order to calculate Price of Product post the discount is applied.
I am fresh to SQL, hence went through few articles.
Came up with Scalar function and in order to execute the above result wrote the below code.
But no Success 🙁
CREATE FUNCTION CalcPrice ( @PriceOrg decimal(10,2), @PrdPrice decimal(10,2) ) RETURNS decimal (10, 2) AS BEGIN DECLARE SELECT(@PriceOrg - @PrdPrice) END
Save the above function and call the function as below
But nothing works for me.
Below Image for the Product table