Solved

# in Column Name - within Query

Posted on 2014-04-12
9
440 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 83

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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 83

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
 

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 83

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 83

Expert Comment

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

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

860 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