Hi
Incorrect syntax near the keyword 'Select'. & Must declare the scalar variable "@Opening".
SQL
Declare @fr_Date as Date
Set @fr_Date = '2011/11/11'
declare @to_Date as Date
Set @to_date = '2021/10/10'
Declare @Opening as double
Select @Opening = (SUM(Credit)-SUM(Debit)) from JDT1 where RefDate = '2010/11/11' AND JDT1.RefDate < @fr_dateThanks

Sachin SinghRank #66 · 26.2K reputationPosted Mar 20, 2022, 4:12 AM EDT