Renaming columns in MS Query

G

Guest

I use several MS Queries to import into Excel '03 workbooks via ODBC from our
corporate mainframe (linked Access tables). I would like to rename the column
headings in the query design before returning the results to Excel. However,
despite the options to do so, I keep getting error messages about a 'missing
expected lexical'. I even tried editing the SQL statement but got the same
results. What's the trick to make MS Query rename the columns?
 
G

Guest

At a guess, you're trying to use column names that have spaces. Enclose
those names within a pair of single quotes.

select lname as 'Last Name' from somedatabase
 
G

Guest

This is an example of what I have : UnitofMeasure. What I want is UOM. There
are about 6 other columns but this is simply an example. If I can fix this
one the rest will be easy.

When using the suggestion below I get the error code: 'unexpected lexical
element missing:<identifier>'. Please tell me what this means and a
work-around. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top