Concatenate fields and use the Alias field to link another field in another table
I have two tables that I would like to link together for making labels. I would like to link the tables together to get my results. The issue lies when I inner join the tables. table a has two fields and table b has one field that I need to link together to get my results. I was able to get the alias to link the tables together, but I get stuck on how to link an alias to another table in the same query.
Here is the tables and my query
Base_ID Lot_ID Part_ID Printed_Date
WO-00009 1 112A7000 12/31/2012
Part_ID AProperty_1 SN
112A7000 WO-00009/1 SN1223
I would like the results to be
Part_ID SN Printed_Date
112A7000 SN1223 12/31/2012
I think my issue is with the Alias . .
SELECT WORK_ORDER.BASE_ID, WORK_ORDER.LOT_ID, WORK_ORDER.PART_ID, [WORK_ORDER].[BASE_ID]+ '/' + [WORK_ORDER].[LOT_ID] AS WO
INNER JOIN TRACE ON WORK_ORDER.PART_ID = TRACE.PART_ID AND WO = TRACE.APROPERTY_1
WHERE WORK_ORDER.PRINTED_DATE > 12/31/12
Thanks so much!! Happy New Year!!
Microsoft SQL Server
8/22/2022 - Mon
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!