Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join tables with same name fields

Status
Not open for further replies.

teqtaq

Technical User
Nov 18, 2007
197
US
When 3 tables linked and each has LN and FN in it - how do I take care of EmplID:[LN]&", "&[FN] and MngrID:[LN]&", "&[FN] and than HiringMngrID:[LN]&", "&[FN]

It seems like if I am leaving those fields in the query and joining them on the Report level - I am getting blank fields. Query works fine because every LN FN has a table assocoation. But when on Report level - it gets confused? Please, advise.
 
Give them different aliases in the SQL
Code:
Select Emplid.LN As ELN, MngrID.LN As MLN, etc..

Usually something like
Code:
Select Emplid.LN, MngrID.LN, etc..
ends up with fieldnames "Emplid.LN, MngrID.LN" in the generated table.
 
More importantly, why do you have 3 tables with FN and LN? This indicates your tables are not normalized. See:
Fundamentals of Relational Database Design

FN and LN should be stored in only one table. If your tables aren't normalized, your database probably has more problems.
 
Thanks to all.

Unfortunatelly I am the only IT in HR so tables were built for us by somebody and I am not on a position to say anything. I would though:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top