Using Aliases

  • Thread starter Thread starter nd
  • Start date Start date
N

nd

Access 2k with the following setup:
Our facility produces a substance that is used to coat
parts we also produce.
TblProduction captures how the substance is made with
BatchID being the primary key in that table. TblParts
captures how the part was made and what BatchID was used
to coat the top(TopCoatID) and the underside(UnderCoatID)
of the part. 99% of the time a different batch is used for
the 2 coatings. I needed a query to give me the PartID,
the TopCoatID, UnderCoatID, and a couple of other relevant
fields for the top and undercoat batches. I actually
created 2 queries based on tblProduction and then joined
them as follows: SELECT tblParts.PartID,
tblParts.CreateDate, tblParts.Type, tblParts.TopCoatID,
qryTopCoat.CComposition AS TopCoatComposition,
tblParts.UnderCoatID, qryUnderCoat.CComposition AS
UnderCoatComposition
FROM (tblParts INNER JOIN qryTopCoat ON tblParts.TopCoatID
= qryTopCoat.BatchID) INNER JOIN qryUnderCoat ON
tblParts.UnderCoatID = qryUnderCoat.BatchID;
The data looks ok except that the field aliases aren't
working. How to fix? And/or is there a better solution.
 
What do you mean "the field aliases aren't working"? Are the aliases not
showing up as field headers?
 
Dear nd:

I edit your query for my own readability preferences:

SELECT tblParts.PartID, tblParts.CreateDate, tblParts.Type,
tblParts.TopCoatID, qryTopCoat.CComposition AS TopCoatComposition,
tblParts.UnderCoatID,
qryUnderCoat.CComposition AS UnderCoatComposition
FROM (tblParts
INNER JOIN qryTopCoat ON tblParts.TopCoatID = qryTopCoat.BatchID)
INNER JOIN qryUnderCoat
ON tblParts.UnderCoatID = qryUnderCoat.BatchID;

Now, when you run this query, are you saying the 5th column is not
coming out named "TopCoatComposition" and the 7th column is not
"UnderCoatComposition"? It is possible someone has renamed those
columns in the query grid. Copy the SQL of this query, create a new
query, and paste it in, then run it with no other changes. Does this
fix it?

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Yes, what I mean is that the aliases are not showing up as
field headers. What shows up is the Field Caption from the
table. Copying and pasting the code into a new query
didn't have different results.
 
Back
Top