isames
asked on
SQL Query Subtract
i have two columns: Beginning Balance, Ending Balance.
I would like to sum each column and then subtract. the output would be the Actual.
or the query could probably just subtract the two columns without doing the sum.
Attached is the table
Accounting.png
I would like to sum each column and then subtract. the output would be the Actual.
or the query could probably just subtract the two columns without doing the sum.
Attached is the table
Accounting.png
ASKER
For now, just subtract the two columns.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Select CompanyID, Sum(d.theDifference)
From (Field1-Field2 AS theDifference
From TableNameYouHave) AS d
Group By CompanyID
Please replace Field1, Field2, TableNameYouHave as you have.
Mike
isames, do you still need help on this question?
ASKER
I believe I'm okay on this one.
Thank you
Thank you
Or do you want to have the aggregated balance for e.g. each companyID?