I've query like this
Select TrID, Amount, Sum(GrowthAmt) As Growth, 'PRINCIPAL' as mHead from GrowthMast where TrDesc ='Commitment' and AppMstID =@MyCode and PaidTag=1 Group by TrID, Amount
UNION ALL Select TrID, SUM(Amount), Sum(GrowthAmt) As Growth , 'PRINCIPAL PAID' as mHead from GrowthMast where TrDesc ='Commitment withdrawal' and AppMstID =@MyCode and PaidTag=1 Group by TrID, Amount
UNION ALL Select TrID, Amount, Sum(GrowthAmt) As Growth , 'GROWTH' as mHead from GrowthMast where TrDesc ='Growth' and AppMstID =@MyCode and PaidTag=1 Group by TrID, Amount
UNION ALL Select TrID, Amount, Sum(GrowthAmt) As Growth , 'GROWTH PAID' as mHead from GrowthMast where TrDesc ='Growth withdrawal' and AppMstID =@MyCode and PaidTag=1 Group by TrID, Amount
It returns row like
TrID Amount Growth mHead
Z505893464 45000 0 PRINCIPAL
Z347456519 100000 0 PRINCIPAL
Z505893464 200 0 PRINCIPAL PAID
Z347456519 500 0 PRINCIPAL PAID
Z505893464 45000 900 GROWTH
Z347456519 100000 8000 GROWTH
Z347456519 300 0 GROWTH PAID
Now I need final output like
TrID, Amout where mHead ='PRINCIPAL',Amout where mHead ='PRINCIPAL PAID', Amount where mHead ='GROWTH PAID'
Can anyone help?
VB6/ASP.NET
------------------------
http://www.nehasoftec.com