Union Select Failing

  • Thread starter Thread starter Bill Stanton
  • Start date Start date
B

Bill Stanton

Just trying to concatenate two tables with like fields. I get
an error message:

"The SELECT statement includes a reserved word or an
argument name that is misspelled or missing, or the
punctuation in incorrect."

Both tables DonRegFamCk and DonRegFam$$ define fields:
FundID, Amount, DOE, FamilyID
where FundID is the ID of the fund title in table "Funds".

SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID],
FROM [DonRegFamCk] INNER JOIN [Funds],
ON [DonRegFamCk].[FundID] = [Funds].[FundID],
UNION SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID],
FROM [DonRegFam$$] INNER JOIN [Funds],
ON [DonRegFam$$].[FundID] = [Funds].[FundID];

What am I missing?

Thanks,
Bill Stanton
 
If that is your exact code, nothing is missing. However, you do have MORE than
you need.

You have an extraneous comma before the ON in both sections of the query and
another comma before the UNION and another before the FROM in each section.

SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID]
FROM [DonRegFamCk] INNER JOIN [Funds]
ON [DonRegFamCk].[FundID] = [Funds].[FundID]
UNION
SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID]
FROM [DonRegFam$$] INNER JOIN [Funds]
 
Thanks John.
Bill


John Spencer (MVP) said:
If that is your exact code, nothing is missing. However, you do have MORE than
you need.

You have an extraneous comma before the ON in both sections of the query and
another comma before the UNION and another before the FROM in each section.

SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID]
FROM [DonRegFamCk] INNER JOIN [Funds]
ON [DonRegFamCk].[FundID] = [Funds].[FundID]
UNION
SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID]
FROM [DonRegFam$$] INNER JOIN [Funds]
Just trying to concatenate two tables with like fields. I get
an error message:

"The SELECT statement includes a reserved word or an
argument name that is misspelled or missing, or the
punctuation in incorrect."

Both tables DonRegFamCk and DonRegFam$$ define fields:
FundID, Amount, DOE, FamilyID
where FundID is the ID of the fund title in table "Funds".

SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID],
FROM [DonRegFamCk] INNER JOIN [Funds],
ON [DonRegFamCk].[FundID] = [Funds].[FundID],
UNION SELECT [Funds].[FundTitle],[Amount],[DOE],[FamilyID],
FROM [DonRegFam$$] INNER JOIN [Funds],
ON [DonRegFam$$].[FundID] = [Funds].[FundID];

What am I missing?

Thanks,
Bill Stanton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top