Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-23-2009, 08:44 AM   #1
ConfusedA
Newly Registered User
 
Join Date: Jun 2009
Location: Toronto, Canada
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
ConfusedA is on a distinguished road
Syntax Error in FROM clause... help

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

ConfusedA is offline   Reply With Quote
Old 10-23-2009, 08:46 AM   #2
boblarson
Smeghead
 
boblarson's Avatar
 
Join Date: Jan 2001
Location: Oregon, USA
Posts: 32,068
Thanks: 97
Thanked 1,807 Times in 1,573 Posts
boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold boblarson is a splendid one to behold
Re: Syntax Error in FROM clause... help

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]
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
boblarson is offline   Reply With Quote
Old 10-23-2009, 11:00 AM   #3
ConfusedA
Newly Registered User
 
Join Date: Jun 2009
Location: Toronto, Canada
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
ConfusedA is on a distinguished road
Re: Syntax Error in FROM clause... help

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!

ConfusedA is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with sql syntax plz joet1984 SQL Server 1 12-14-2008 05:05 PM
Help plz with sql syntax joet1984 Other Software 0 12-11-2008 05:50 PM
Syntax error in CONSTRAINT clause in MAKE TABLE query Bilbo_Baggins_Esq Tables 2 04-07-2008 08:46 AM
Syntax error in CONSTRAINT clause Bilbo_Baggins_Esq Modules & VBA 2 04-06-2008 07:40 PM




All times are GMT -8. The time now is 03:38 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World