hi in my tblCurrencySale contains csProfit and csDate..so now i want to calculate total profit
like in my aspx page two dropdowns r der its only date..
so now i want to calculate profit between two dates
like 5/18/2012 and 5/30/2012 when i click search should display total profit in text box..can u suggest me how to give sp and call it in aspx.cs page??
thanks
Hi how to calculate total profit between two dates?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Anil KumarRank #367 · 6.8K reputationPosted May 17, 2012, 10:41 PM EDT
Your procedure would be like this -
CREATE PROCEDURE myProcedueName
@START_DATE DATE,
@END_DATE DATE
AS
BEGIN
SET NOCOUNT ON;
SELECT ISNULL( SUM ( csProfit ) , 0 )
FROM tblCurrencySale
WHERE csDate BETWEEN @START_DATE AND @END_DATE
END
GO