Wrox Programmer Forums
BOOK: Excel 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Excel 2003 VBA Programmer's Reference by Paul T. Kimmel, Stephen Bullen, John Green, Rob Bovey, Robert Rosenberg, Brian Patterson; ISBN: 9780764556609
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2003 VBA Programmer's Reference 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 August 19th, 2010, 12:02 PM
rgi rgi is offline
Registered User
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax for SQL with Date as Column Label?

When I write a SQL statement to query an Excel Table that includes Cells with dates as the Labels (e.g. 1/1/2010, 2/1/2010, etc.) the SQL does not work.

Example: SELECT [Period], [Project], [Category], [1/1/2010]
FROM [M1XNQ_Summary]$ ;

I have tried # symbols, single quotes and double quotes.

Final answer?

BTW - I own the above book and use it daily! Love it!

Thanks in advance.
Old September 14th, 2010, 03:01 AM
Friend of Wrox
Join Date: Sep 2010
Posts: 171
Thanks: 0
Thanked 14 Times in 14 Posts
Default Don't do it, lol

I'm no expert at vba, but i've learned two things: 1, No special symbols in column headers, and 2, make it all one word. Basically, name your column headers with the same rules that apply to naming variables in vba, I.E. start them with a letter, alphanumeric characters only, no spaces.

Also, be careful with putting an apostrophe (') in any data you'll be using sql on, totally botches up the works.

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change pivot tables column label rhawk204 Excel VBA 0 December 23rd, 2009 10:26 AM
Converting Label.caption as Date value devilz Beginning VB 6 2 March 5th, 2009 04:55 AM
comparing date column with sql server mallikalapati ASP.NET 2.0 Professional 3 March 12th, 2008 06:06 PM
Date Format Syntax inspiron VB.NET 2002/2003 Basics 1 November 14th, 2006 03:55 PM
SQL Server date column and ASP treadmill SQL Server 2000 1 July 7th, 2003 08:51 AM

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