Syntax Error in FROM clause... help (1 Viewer)

ConfusedA

Registered User.
Local time
Today, 05:23
Joined
Jun 15, 2009
Messages
101
Hi everyone,

So I've used this syntax before on many union queries and it has worked. Yet for some reason it now refuses to work on my new queries.

I know that some of you will be annoying with my naming conventions for this (but unless that is where the problem actually lies, you don't need to tell me). I can't find anything wrong with what I have here, so I'm not sure where to go with it. Though they appear to be the same, they are actually very different tables with some common information. What I need is to be able to sum the two sets of data so that I have values based on:
Employee-Jobtype-month- with all other values being summed.

Select [Employee], [fldMonth], [fldYear], [Jobtype], [fldHours], [Overtime], [labour], [Overtime Pay], [Call Out Pay], [Standby Pay], [Total Pay]
from qryAll1/2
UNION Select [Employee], [fldMonth], [fldYear], [Job], [fldHours], [Overtime], [labour], [Overtime Pay], [Call Out Pay], [Standby Pay], [Total Pay]
from qryAll1/3;

Hope this makes sense.
Thanks,
ConfusedA
 

boblarson

Smeghead
Local time
Today, 02:23
Joined
Jan 12, 2001
Messages
32,059
Because you've chosen (bad choice by the way) to include a special character in the name you have to enclose it in square brackets:

from [qryAll1/2]
 

ConfusedA

Registered User.
Local time
Today, 05:23
Joined
Jun 15, 2009
Messages
101
Ah, that makes sense. I'll agree with you about that name, I changed it and bracketed the term just to be safe.
Thanks for the advice!
 

Users who are viewing this thread

Top Bottom