I have implemented a Database in my project and following several tutorials, have been able to pull data and display in listviews. I, however, have not been able to search and find a solution to my current problem.
I have two columns in a table. The columns are: TABLE_UNITS and TABLE_PRICE and they are in the table TABLE. I want to display a combined portfolio of sorts where each rows, UNITS and PRICE have to be multiplied and this sub total will be added for each row present in the database. To make it clearer:
UNITS —- PRICE —- TOTAL
50————5———–250
20————10———-200
GRAND TOTAL ——- 450
So the question is, how do I pull all this information into, say a string, and then calculate and then get the next row, do the same calculation and get the Grand Total?
Perhaps this query can help you:
for grand total, you need to run a separate query: