I thought I had this answered from a previous post, but I still can’t get this right. I’ll try this another way and simplify it:
Query 1:
SELECT SUM((TA.task_average*TC.completed)/60) AS manual
Query 2:
SUM(M.minutes/60) AS automatic
I need to subtract query 2 from 1. I would like to combine it if possible and avoid multiple queries. I have all of my joins and groupings how I need them it’s this piece I am having a heck of a time with.
Edited with final (included rounding to two decimal places):
ROUND((SUM((TA.task_average*TC.completed)/60) - SUM(M.minutes/60)),2) AS diff
You can just subtract them like this: