With CTE_Test
as
(select sno,[date],[desc],amt,creit,debit,Total,Row_number() over (PARTITION By date order by sno) as rowno
from temp_Table
union all
Select MAX(sno)+1,[date],'Total',null,SUM(creit),SUM(Debit),Null,1 from temp_table group by [date]
union all
Select MAX(sno)+2,[date],'Balance',null,SUM(creit)-SUM(Debit),null,Null,1 from temp_table group by [date])
Select * from cte_test order by date,sno