Solved

# in Column Name - within Query

Posted on 2014-04-12
9
436 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

777 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