Link to home
Start Free TrialLog in
Avatar of BobBarker_99
BobBarker_99

asked on

SQL Query - Calculate SUM Across two tables

This must be really simply, but I'm not seeing how to do it right now.

I want to do the following in 1 sql statement so I dont have to do 2 data access.

SELECT SUM(fldAmount) from tbl1 where fldID = @ContactID
-
SELECT SUM(fldRate * fldHours) from tbl2 WHERE fldID = @ContactID

(there is a subtraction between the 2 sums)
ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BobBarker_99
BobBarker_99

ASKER

Doh, I had that all along, just missing a bracket gave me a cryptic error msg.  Thanks