| total | vat rs | discount % |
| 500 | 5 | 2 |
| 1000 | 2 | 2 |
| 1200 | 10 | 5 |
i want my result to be calculated as
(500+5) * 2/100 =a
(1000+2)*2/100=b
(1200+10)*5/100=c
" " " " "
""""""
""
and result = SUM(a+B+C) rs.
this is what i tried
cmd = new SqlCommand("Select (SUM(P_ttotal)+SUM(P_vatto)* (P_totdis)/100) as dis from PRO_BILL", conn);
but it is throwing exception P_totdis is not in group by clause....
help me in this.
any help will be appreciated

varsha dodiyaPosted Aug 28, 2014, 2:22 AM
Select Cast(SUM((O_ttotal + P_vatto) * (P_totdis / 100)) As Decimal(9,2)) As TotalDiscount From PRO_BILL
varsha dodiyaPosted Aug 22, 2014, 6:23 AM
Khan Abrar AhmedPosted Aug 22, 2014, 5:36 AM
like
cmd = new SqlCommand("Select (SUM(P_ttotal)+SUM(P_vatto)* (P_totdis)/100) as dis from PRO_BILL group by P_totdis", conn);