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
Loading

Anil KumarPosted May 18, 2012, 2:41 AM
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