-余额比上一季度末增量
set @lastqtr=dbo.f_getlastqtr(@trans_date)   
set @inc_qtr=
            (select sum(case when flag='0'then -amt else  amt end)
             from t_journal 
             where account_no=@account_no and month(trans_date)<=month(@trans_date)and month(trans_date)>month(@lastqtr) )