I want to display data before date ,but it is displaying greater then that date
select M.Sell_ID,M.E_Date,M.Level_Four_ID as ID,(isnull(cast(M.Sell_Amt as float),0))-(isnull(cast(R.Rec_Amt as float),0))as Pending
from tbl_Sell_M M inner join tbl_Received_Amount R on R.Sell_ID=M.Sell_ID
where M.E_Date<'2021-03-01' and M.Level_Four_ID=320222
--group by M.Level_Four_ID
Result is
