How would I go about adding two columns from one table to a select query for another table based on a column value in the table being selected from?
Here is my first attempt at an INNER JOIN which doesn't work, but hopefully my incorrect code shows what I'm trying to accomplish
SELECT CLQM001ID AS ImportID,
DIV AS Division,
DEPT AS Department,
CREATED_DATE AS Date_1,
STAKEHOLDERSUP AS StakeholderSupplier,
JOBNUM AS Job,
ITPNUM AS ITPNo,
PROBLEM AS ProblemDetails,
ROOTCAUSE AS RootCauseDescription,
PRIMARYROOTCAUS AS PrimaryRootCauseType,
SECONDROOTCAUSE AS SeconadryRootCauseType,
Cost AS Cost_1,
DISPOSITIONFINAL AS Disposition,
VERIFCORECTACT AS CorrectEffective,
NOTES AS VerifyNotes
FROM RB1_CLQM001 AS qm
INNER JOIN ACTIVITIES.CODE ON qm.ACT = ACTIVITIES.ID
INNER JOIN ACTIVITIES.[DESCRIPTION] ON qm.ACT = ACTIVITIES.ID
This way get's me the error " Invalid object name 'ACTIVITIES.CODE'. "
If I remove the dot between the ACTIVITIES table and the CODE column name I get the following error: " The multi-part identifier 'ACTIVITIES.ID' could not be bound."