G
giminera
I've got a dataset on a datagridview: fileds are
code,descr,price,vatcode. I have to calculate the total amount of
vat.
Example:
first row = price 10$, vatcode 20
second row = price 50$, vatcode 10
third row = price 10$, vatcode 20
So, I have a SQL Table with vatcode and vat%, for example vatcode 20 =
20%, vatcode 10 = 10%
The goal is to group the rows of dataset (datagridview) by the vatcode
and calculate the total price for every different vatcode, for
example:
amount of 20$ (sum of first and third rows) with vatcode 20.
amount of 50 with vatcode 10 (the only one in the datagrid with that
vatcode).
After I have to calculate the entire amount of vat, so I have 20$ at
20% and 50$ at 10% and put it into a variable.
Thanks.
George
code,descr,price,vatcode. I have to calculate the total amount of
vat.
Example:
first row = price 10$, vatcode 20
second row = price 50$, vatcode 10
third row = price 10$, vatcode 20
So, I have a SQL Table with vatcode and vat%, for example vatcode 20 =
20%, vatcode 10 = 10%
The goal is to group the rows of dataset (datagridview) by the vatcode
and calculate the total price for every different vatcode, for
example:
amount of 20$ (sum of first and third rows) with vatcode 20.
amount of 50 with vatcode 10 (the only one in the datagrid with that
vatcode).
After I have to calculate the entire amount of vat, so I have 20$ at
20% and 50$ at 10% and put it into a variable.
Thanks.
George