Union All

Smudger Smith

I like numbers me
Local time
Today, 16:46
Joined
May 30, 2007
Messages
25
Hi,

Can anyone please tell me what I am doing wrong here?

SELECT *
from Qry_300_Sel_In Jan not Dec

UNION ALL

SELECT *
from Qry_301_Sel_In Apr not Dec

UNION ALL

SELECT *
from Qry_302_Sel_In Jul not Dec

UNION ALL SELECT *
Qry_303_Sel_In Oct not Dec;

It is telling me that my syntax is wron in the From clause - But I don't get it!
 
When you examine one query,
Code:
SELECT *
from Qry_300_Sel_In Jan not Dec
"from Qry_300_Sel_In Jan not Dec" doesn't make any sense.
If "Qry_300_Sel_In Jan not Dec" is the name of the query use [Qry_300_Sel_In Jan not Dec]
But i think you want something else.

Examine the "WHERE" clause of a query.

Start with one query and then build the next until all queries produce the result you want. Then paste them all together in a UNION query.

Name all the fields in your select statement. That way when you add a field to a query that you use, the union query will always work.

HTH:D
 
Last edited:
Yep Guus is right.... which is why I allways tell people to NOT use spaces in your table/column/query/form etc names...

It prevents a lot of problems
 
Thanks to you both.

Indead the "[..]" did work and shame on me for using spaces!

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom