I have this code that supposed to search from this date to another date then sum Amount_Deposited then display the sum in textbox txttotalamount.
But its not displaying the sum, instead its displaying the actuall amount in one column
See database below
ID Date Deposit_Amount
1 2021-04-08 10000
2 2021-04-10 10000
So i wanted to search from 2021-04-08 to 2021-04-10 then sum the amount_deposited then display the result in textbox txttotalamount. But this code only displays 10,000 instead of 20,0000.
ALTER PROCEDURE [dbo].[GetReportsDate]
@From DateTime,
@ToDate DateTime
AS
SELECT Date,SUM(Deposit_Amount) AS Deposit_Amount,Date FROM Deposit WHERE (Date BETWEEN @From AND @ToDate) GROUP BY Date
RETURN 0