Solved

# in Column Name - within Query

Posted on 2014-04-12
9
427 Views
Last Modified: 2014-04-12
Hello All,

There are several joined tables and I created a query that joins them and pulls data with new column headers. One column (old name : NumOfP) gets renamed as [# of P] in that query.

When I try to extract that query into excel via right clicking, I see that the result excel file has the column name as [. of P] not [# of P] - why is that....and cant this be fixed so that the extract pulls the column names as desired
0
Comment
Question by:Rayne
  • 5
  • 4
9 Comments
 

Author Comment

by:Rayne
ID: 39996849
thank you
0
 

Author Comment

by:Rayne
ID: 39996850
also if i vba it so that the query results from access, gets dumped directly in a separate excel file - will the above issue still persists?
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39996876
I don't know the exact answer to your question but you are doing two things that I would never do.  #1. putting symbols/punctuation in column names.  #2. putting spaces in column names.  In other databases like MySQL or Microsoft SQL Server, those would cause you problems.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39996879
'identifier' rules for Microsoft SQL Server http://technet.microsoft.com/en-us/library/ms175874.aspx  and for MySQL http://dev.mysql.com/doc/refman/5.6/en/identifiers.html  You might be able to use names that are not strictly alphanumeric and/or include spaces if you quote them.  Otherwise you are usually restricted to alphanumeric like [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore) .
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Rayne
ID: 39996890
Hello Dave,

I think you misunderstood. I am following all the proper naming conventions (no spaces, no # etc)  for column names within the actual table. So that's not an issue.


When my query pulls in the data, one of the fields from a table needs to have [# of P] as the extract column....do you get it?
0
 

Author Comment

by:Rayne
ID: 39996891
its for readibility for the end users
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39996893
But it's still a column name in your output results so it is an issue.  I don't think you can do that while you are still in Access (or any other database).  If you can extract the data with VBA, you can have VBA name the display whatever you want.
0
 

Author Comment

by:Rayne
ID: 39996904
Hmm, good call - totally forgot :(
Thank you Sire for your kindness
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39996948
You're welcome, glad to help.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now