Using Alias fields in Microsoft Query

  • Thread starter Thread starter gary
  • Start date Start date
G

gary

Does anyone have any info on why using Aliases in a SQL
query don't work in microsoft query. I have tried Office
2002 SP3 and Office 2003 and neither work.
When I enter the following as part of a query it strips
off everything after the AS.
SELECT Customers.strName AS [Customers]
 
...
Does anyone have any info on why using Aliases in a SQL
query don't work in microsoft query. I have tried Office
2002 SP3 and Office 2003 and neither work.
When I enter the following as part of a query it strips
off everything after the AS.
SELECT Customers.strName AS [Customers]

This style of alias works for me in MS Query e.g. this using northwind:

SELECT Customers.CompanyName
AS [CustomerName]
FROM Customers

Your problem may be covered by the following:

Microsoft Knowledge Base Article - 298955
Using a field alias in Query does not work with some third-party databases
http://support.microsoft.com/default.aspx?scid=kb;en-us;298955

Jamie.

--
 
...
try = instead of as

I tried this (northwind):

SELECT Customers.CompanyName
= [CustomerName]
FROM Customers

and got an error, 'Incorrect column expression'.

Jamie.

--
 
When I'm in MS Query, I double-click on the column to bring up the "Edi
Column..." dialog box and change the column name there. In the SQ
statement it looks like this:

SELECT BLDG.BLDGNAME AS 'Property Name'

I'm using Excel 2000 and my queries are against a SQL 2000 db
 
When I'm in MS Query, I doulble-click on the column to bring up th
"Edit Column..." dialog box and change the column name there. In th
SQL statement it looks like this:

SELECT BLDG.BLDGNAME AS 'Property Name'

I'm using Excel 2000 and my queries are against a SQL 2000 db
 

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

Back
Top