Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2006, 09:15 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default UNION QUERY Help

I'm getting an error message that reads

Syntax error (missing operator) in query expression "Program ID'.

My Union Query is:
SELECT Program ID, program name, Sent, Delivery Rate, Open Rate, # Clicks, Net Sales, Net Units, Net Orders, Gross Sales, Gross Units, Gross Orders
From [qrySonic_Circ_Repot_B1]
UNION Select Program ID, program name, Sent, Delivery Rate, Open Rate,# Clicks, Net Sales, Net Units, Net Orders, Gross Sales, Gross Units, Gross Orders
From [qrySonic_Circ_Repot_C1];

Can anyone please help me with this error?

Thanks
Corey


 
Old October 27th, 2006, 05:29 PM
Registered User
 
Join Date: Oct 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Corey

I think you'll find you have to square bracket your field names as below

SELECT [Program ID], [program name], Sent, [Delivery Rate], [Open Rate], [# Clicks], [Net Sales], [Net Units], [Net Orders], [Gross Sales], [Gross Units], [Gross Orders]
From [qrySonic_Circ_Repot_B1]
UNION Select [Program ID], [program name], Sent, [Delivery Rate], [Open Rate],[# Clicks], [Net Sales], [Net Units], [Net Orders], [Gross Sales], [Gross Units], [Gross Orders]
From [qrySonic_Circ_Repot_C1];


SQL does not like spaces between field name, it assumes that they are separate fields.

Martin





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Parameter in a Union Query bright_mulenga Access VBA 8 January 25th, 2008 08:13 AM
Date Parameter in a Union Query bright_mulenga Access VBA 0 January 17th, 2008 03:52 AM
Union query in Access?? lisabb Access 5 October 24th, 2007 10:04 PM
UNION query. rupen Access 3 April 28th, 2006 02:49 AM
Error on Make-Table Query In Union Query rylemer Access 1 August 20th, 2003 07:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.