gilligan73
New Member
- Joined
- Jul 16, 2014
- Messages
- 8
Hello all,
I seem to be having a problem with MS Query, as I am used to MS SQL database but am not allowed to use it. I am trying to join two queries, based on the country name being the same. I actually got it work once but I can't seem to see what I am doing wrong.
I am using Excel 2010:
The sheet names are theData and ConcreteData:
select a.CountryName, Sum(a.FinalAmount) as Total
from
(SELECT [TheData$].CountryName as Country, [TheData$].FinalAmount as amt
FROM [TheData$] [TheData$]
union all
SELECT [ConcreteData$].Country as Country, [ConcreteData$].TotalKV as amt
FROM [ConcreteData$] [ConcreteData$]
) a
GROUP BY a.Country
I get "Could not add the table 'SELECT'" as an error message.
Many thanks in advance,
Dave
I seem to be having a problem with MS Query, as I am used to MS SQL database but am not allowed to use it. I am trying to join two queries, based on the country name being the same. I actually got it work once but I can't seem to see what I am doing wrong.
I am using Excel 2010:
The sheet names are theData and ConcreteData:
select a.CountryName, Sum(a.FinalAmount) as Total
from
(SELECT [TheData$].CountryName as Country, [TheData$].FinalAmount as amt
FROM [TheData$] [TheData$]
union all
SELECT [ConcreteData$].Country as Country, [ConcreteData$].TotalKV as amt
FROM [ConcreteData$] [ConcreteData$]
) a
GROUP BY a.Country
I get "Could not add the table 'SELECT'" as an error message.
Many thanks in advance,
Dave