Link to home
Start Free TrialLog in
Avatar of simsima_7876
simsima_7876

asked on

Sum the values from 2 different queries in 1 query

Hi Experts

I have the 2 queries below, each of which gives me one number.  I want to be able to create a query which uses these 2 queries as subqueries so the 2 values can be summed and I have one total.  Can you help?

SELECT Sum([Pnl by GL - Accounting result].[SumOf7 Total Pnl YTD]) AS GL_ACCOUNTING
FROM [Pnl by GL - Accounting result]
WHERE ((([Pnl by GL - Accounting result].ReportCategory)="HTM" Or ([Pnl by GL - Accounting result].ReportCategory)="Loans&Receivables") AND (([Pnl by GL - Accounting result].AcctArea)="BA_AMADEUS" Or ([Pnl by GL - Accounting result].AcctArea)="BA_TOP_UP" Or ([Pnl by GL - Accounting result].AcctArea)="BA_CDS_HDG" Or ([Pnl by GL - Accounting result].AcctArea)="HENDERSON") AND (([Pnl by GL - Accounting result].AccountCode)=5865000000));

and

SELECT Sum([PnL by GL - Interest].[SumOf11 TotalInterest]) AS GL_INTEREST
FROM [PnL by GL - Interest]
WHERE ((([PnL by GL - Interest].ReportCategory)="Loans&Receivables" Or ([PnL by GL - Interest].ReportCategory)="HTM") AND (([PnL by GL - Interest].AcctArea)="BA_AMADEUS" Or ([PnL by GL - Interest].AcctArea)="BA_TOP_UP" Or ([PnL by GL - Interest].AcctArea)="BA_CDS_HDG" Or ([PnL by GL - Interest].AcctArea)="HENDERSON"));
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland 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 simsima_7876
simsima_7876

ASKER

Thanks very much.  Super quick!