#  Other Applications & Softwares  > Access Tables & Databases >  >  Microsoft Query:  Change Column Name

## marysever

I have a number of columns downloaded from my database that do not reflect the type of data in the column, e.g., user_1, user_2, etc. I need to rename the columns. I have tried double clicking on the column and entering the new name in the Column heading field but it does not accept any of the names I enter. I've tried with quotes, double quotes, brackets, parentheses. I usually get "expected lexical element not found".  I've tried typing into the SQL statement under View in the ribbon but get the same message.

After downloading to Excel I can change the header but upon refresh they revert back to the original names.  I can change the names in the Excel Connection Properties Command Text box.  This works but if I need to edit the query, I get an error message and the data disappears from Microsoft Query.  Is there any way to rename the columns in Microsoft Query?

----------


## TMS

I'm no expert, but I'm guessing that your query must refer to the column/field headings in your database. So, if you change what you call the fields in your query, it won't be able to match them to the database.

----------


## marysever

True but I'm sure there's many times that people want to change the database name to something else for reporting purposes.  I would think there is a way to do it.

----------


## Norie

You could alter the SQL for the query to use aliases for the column names you want to change.

----------


## marysever

I'm not sure how to do that

----------

