Assigning an Alias

S

Stever

I have a query that I need to have assign an alias to the returned field
name.
SELECT Company.TypeofCompany AS Categories FROM Company;
The TypeOfCompany field refers to a lookup field in the Company table. The
problem I have is that the alias is not showing up when I run the query.
When I try assigning alias to other fields, it works fine. It only fails on
the lookup field.

Any ideas what is causing this?

Thanks

Steve
 
J

John Vinson

I have a query that I need to have assign an alias to the returned field
name.
SELECT Company.TypeofCompany AS Categories FROM Company;
The TypeOfCompany field refers to a lookup field in the Company table. The
problem I have is that the alias is not showing up when I run the query.
When I try assigning alias to other fields, it works fine. It only fails on
the lookup field.

Any ideas what is causing this?

Probably the fact that it IS a lookup field.

A lookup CONCEALS the actual contents of your table - a numeric
foreign key - behind the looked-up value. The TypeOfCompany DOES NOT
EXIST in your companies table. It's in the lookup table instead.

You need to join the lookup table to the company table to find the
actual text category.

John W. Vinson[MVP]
 

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

Similar Threads


Top