Calculating value of records from a column - classic asp
Posted on 2016-09-19
Yes - Classic ASP - I'm that old...
AnywaY - I have a table in my mysql database that I use to store all actions performed on a specific task. Let's call it TaskHistory. I have another table - let's call it TaskList - that contains the newest version of the task - a clumsy revision management system you might say.
Anyway - If my users choose the task category "Project" they are given the opportunity to enter a price for this current part of the project. Every time the task is updated a price is therefore added to TaskHistory containing (if applicable) a new price every time. Each of the tasks placed in TaskHistory have the same caseID appended as the original task in TaskList.
What I want to do is this: I want to run through TaskHistory & calculate the total from all of the tasks related to (e.g.) task 21. The current price in entered in Task 21 is 213, however if you calculate the total in TaskHistory the result is 5461. Is this possible?
Also: I have an overview page where I'd like this calculation done on every project in the database - so some kind of loop might be the solution. I'm a total arse head when it comes to programming stuff like this (ask my math teacher) so help is much appreciated!