Hi,
Using the same alias name than the original name is uncommon, at least. From
the query designer, you can define an alias with the syntax:
Expr0001: MyField
in the first line. The produced SQL will then be like
SELECT ... MyField As Expr0001 ... FROM ...
If you are using MS SQL Server, you can use an alias with the same name as
the one of an existing field:
SELECT f1 AS f2, f2 as f1 FROM Orders
because MS SQL Server consider aliases only at the end of the process. With
Jet, you cannot, since Jet considers aliases in the middle of the process:
SELECT f1 + f2 As MySum, MySum / 2 As MyMean FROM somewhere
is possible in Jet, note that the alias mySum is re-used in an expression to
the right of its definition, but that is not allowed at all in MS SQL
Server. That also means that Jet does not like ambiguity, if an alias is the
same than an existing field (while with MS SQL Server, the co-existence of
the two, the original field name and the alias, is impossible, at a given
point in time).
Hoping it may help,
Vanderghast, Access MVP
Eric Rodriguez said:
Michel,
Where do I type this alias? The field name is "Detail" so I put SELECT
Detail AS Detail FROM Detail in the top line of the query but it says the
expression has errors.
Eric
Michel Walsh said:
Hi,
Can't you use an alias, in your context:
SELECT this AS that
FROM ...
and what would have been under the field name [this] will now be under
the
field name [that]
Hoping it may help,
Vanderghast, Access MVP
message
I've run a query but in the results, one of the fields is labeled
"Field0"
How can I change this to the name of the actual field in the
table/query?