Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 26th, 2006, 10:15 AM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
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


Reply With Quote
  #2 (permalink)  
Old October 27th, 2006, 06:29 PM
Registered User
 
Join Date: Oct 2006
Location: Leigh, Lancashire, United Kingdom.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 11:04 PM
UNION query. rupen Access 3 April 28th, 2006 03:49 AM
Error on Make-Table Query In Union Query rylemer Access 1 August 20th, 2003 08:42 PM



All times are GMT -4. The time now is 12:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.