Union Query Syntax Error

G

Guest

I want to link several queries together and have them display thier data all
at once for export. Each individual query works just fine, although they do
each require that a piece of data in their WHERE clauses come from a form
that will be open. The query is as follows:

SELECT * FROM qryExportEstimate2Primavera

UNION

SELECT * FROM qryPrimaveraFISI

UNION

SELECT * FROM qryPrimaveraMaterialCost

UNION SELECT * FROM qryPrimaveraOH&P;

However, whenever I try to run it, I get the error: "Syntax Error in FROM
clause."

What's the problem?

Thanks!

Dustin
 
D

Douglas J. Steele

Assuming both queries have matching fields (same number of fields, each
corresponding field is the same type), I'd actually expect the special
character in qryPrimaveraOH&P to cause problems. See whether enclosing the
name in square brackets ([qryPrimaveraOH&P]) helps.
 
G

Guest

Thanks! That was it!

Dustin


Douglas J. Steele said:
Assuming both queries have matching fields (same number of fields, each
corresponding field is the same type), I'd actually expect the special
character in qryPrimaveraOH&P to cause problems. See whether enclosing the
name in square brackets ([qryPrimaveraOH&P]) helps.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dustin Ventin said:
I want to link several queries together and have them display thier data
all
at once for export. Each individual query works just fine, although they
do
each require that a piece of data in their WHERE clauses come from a form
that will be open. The query is as follows:

SELECT * FROM qryExportEstimate2Primavera

UNION

SELECT * FROM qryPrimaveraFISI

UNION

SELECT * FROM qryPrimaveraMaterialCost

UNION SELECT * FROM qryPrimaveraOH&P;

However, whenever I try to run it, I get the error: "Syntax Error in FROM
clause."

What's the problem?

Thanks!

Dustin
 

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

Similar Threads

Union Query and Field Alias 7
append with union query? 6
Query is too complex 5
Union query 5
Union Query 2
Union Query Not work 4
Union Query of Two Queries (Part 2) 2
Union query not working with * 3

Top