0

Dear everybody hope someone can help me!!

Im trying to SUM data from 2 different tabels without any ID connection between and I what to subtract the results from eachother afterwards.. how do i do that.

lets say i have tabel1.costs and tabel2.profit
I would like to SUM the data from the two tabels and then subtract the results from eachother..?? Possible?

Im running MS SQL 2005

Best regards from Kristian

2
Contributors
2
Replies
5
Views
8 Years
Discussion Span
Last Post by 21KristianN
0
Select
(
  Select Sum(Costs)
  From Table1
)
-
(
  Select Sum(Profit)
  From Table2
) As RetainedEarnings
0

thanks for your quick reply - i have been working for hours and hours trying to solve it.. with all sorts of UNION and Union all statements..thanks.. I have marked it at solved.. hope thats the right thing to do

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.