I have a table that has various columns relating to different charges to a job. The final column (standard_sched) contains a total for each row including any tax etc applied to that row.
Now, if there is anything specified in the labout amount column, I want to sum the total column for each of those rows on the table. eg:
Similarly, i want to do the same thing for 3 other columns:Code:SELECT SUM( standard_sched ) AS labour_revenue FROM jrs WHERE labour_amt > 0 AND job_number = '$job'
...etc.Code:SELECT SUM( standard_sched ) AS equip_revenue FROM jrs WHERE equip_amt > 0 AND job_number = '$job'
Each of these columns are mutually exclusive, so if there is any entry in labour amount, there will be no entry in equipment amount.
Is there a way to efficiently combine these?
Thanks,
Matt.![]()








Bookmarks