Make Table Query - New Field Name

G

Guest

In a Make Table Query, how can I have the fields in the new table be
different from the field name in the source table? For example - Expr1 in the
source table should be Name in the destination (new) table.
 
A

Allen Browne

In your query, alias the fields with the name that you want. You do that by
typing a suitable name in front of the field name in the Field row, and add
a colon.

For example, if you currently have:
Expr1: [FirstName] & " " & [Surname]
use:
FullName: [FirstName] & " " & [Surname]

Or if you want to call the City field Suburb:
Suburb: City

BTW, don't use Name as a field name. Nearly everything in Access has a Name
property, so Access will get confused between the name of the field and the
value of the name field on the form, for example.
 
G

Guest

When you look at the query SQL youll see

Select Expr1, Expr2 from tablename

You can change it to
Select Expr1 as NewName1, Expr2 As NewName2 From TableName
=======================================
Or if you have something like
Select Field1 * Field2 As Expr1 From TableName

You can chenge it to
Select Field1 * Field2 As NewName From TableName
 
G

Guest

Worked great - Thanks!

Allen Browne said:
In your query, alias the fields with the name that you want. You do that by
typing a suitable name in front of the field name in the Field row, and add
a colon.

For example, if you currently have:
Expr1: [FirstName] & " " & [Surname]
use:
FullName: [FirstName] & " " & [Surname]

Or if you want to call the City field Suburb:
Suburb: City

BTW, don't use Name as a field name. Nearly everything in Access has a Name
property, so Access will get confused between the name of the field and the
value of the name field on the form, for example.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Racer57 said:
In a Make Table Query, how can I have the fields in the new table be
different from the field name in the source table? For example - Expr1 in
the
source table should be Name in the destination (new) table.
 

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