Hi All,
I don't know if it is possible but can you do something like this:
Code:
SELECT Sum(columnX) As calc1, Sum(columnY) As calc2, (calc1 - calc2) As Difference FROM ... WHERE ... GROUP BY ...
Otherwise I'd have to do this:
Code:
SELECT Sum(columnX) As calc1, Sum(columnY) As calc2, (Sum(columnX) - Sum(columnY)) As Difference FROM ... WHERE ... GROUP BY ...
So instead of calculating the sum twice, I have to do it four times... is there any way to improve this? I've searched everything I could and I found nothing (maybe I was using the wrong keywords, but I'm pretty sure I tried thme all!)
Thanks in Advance!
Warren