SQL:substring(narration,charindex(':',narration)+1,len(narration))
Example : student account debited:term 1
Result : term 1
To add Total we have to add
SELECT dr_account[Arno],amount,substring(narration,charindex(':',narration)+1,len(narration))[Term] FROM dailyACCOUNT
WHERE narration like '%Student A/c Transport Fees Debited%' and status='A'
union all
select dr_account[Arno],sum(amount),'Total'[Term] from dailyACCOUNT WHERE narration like '%Student A/c Transport Fees Debited%' and status='A' group by dr_account
Like this.....
isnull :
isnull(sum([Term - 10]),0) for integer column
isnull(sum([Term - 10]),'') for string column
No comments :
Post a Comment