Using a select query to rename a column name?

ets960

Registered User.
Local time
Today, 08:34
Joined
Jun 2, 2005
Messages
21
Is there any way to use a select query where it will select the values off of my database but temporarily use a different column name for one of the columns???

I have 3 different item names stored in my main table. When I compare this to another table, I want to select one of the item names and just pass that as item_name. This way, I can have the same compare routine instead of writing a different compare routine for each item name. Any way? Thanks a lot for the help in advance!
 
It would be better if you normalized your tables. You have a 1-many relationship that you have flattened into a repeating group. The items belong in a separate table where they can be rows instead of columns.

But, you can rename fields in queries. The renamed values are called alias'.

Select fld1 AS fld1Name, fld2 AS SomeOtherName, etc.
From YourTable;

In the design view, add the new name to the field row in front of the existing name and separated from it by a :
fld1Name:fld1
SomeOtherName:fld2
 

Users who are viewing this thread

Back
Top Bottom