Field alias in sql query

M

Mike

I don´t know if this is the newsgroup...

I´m using a field alias in sql query. In Excel 97 it
worked fine but not in Excel 2000, 2002 or 2003.
I found a knowledge base article - 298955 which describes
how to fix it for 2000 and 2002. But I haven´t found a
solution for excel2003.
My code looks like:
select field.table as 'Resource' from...
Every time I open the sql expression to edit the sql
sentence the alias is gone.
Does anyone know how to solve it for Excel2003?
For new created reports with pivot tables (in 2003) I am
able to save the query as a dqy - file but my problem is
that the reports are originally created with Excel97 so I
haven´t saved the dqy file.

Thanks in advance,
Regards

Mike
 
J

Jake Marx

Hi Mike,

Instead of using SELECT fieldname AS myfield, you could try SELECT
myfield=fieldname. That will look ugly in the query results, but when you
bring it back to Excel, myfield is recognized as an alias for fieldname. It
worked for me, but I didn't try it on XL2003.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 

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