1
i solved it
Select Cast(SUM((O_ttotal + P_vatto) * (P_totdis / 100)) As Decimal(9,2)) As TotalDiscount From PRO_BILL
0
@Abrar that i also know, in this way i get two answers i want the whole total of (A+B+C) not (A+B) and C
0
HI, when you are using the aggregate sql function then you have to define the group by clause.
like
cmd = new SqlCommand("Select (SUM(P_ttotal)+SUM(P_vatto)* (P_totdis)/100) as dis from PRO_BILL group by P_totdis", conn);