I'm trying to adapt code from thread183-1089209 but dont seem to be getting it. Basically, I'm trying to show multiple shift assignments on a single row.
I have two tables:
NURS with the ID
STAFF with the SHIFT Assignments
My adaptation is dorked:
Its telling me "Incorrect syntax near the keyword 'FROM'."
I dont get it...that is the table name
I have two tables:
NURS with the ID
STAFF with the SHIFT Assignments
My adaptation is dorked:
Code:
SELECT N.ANSOS_ID,N.NURS_NAME,
S1.STAFF_SHIFT AS 'SHIFT1' ,
S1.START_TIME AS 'START1' ,
S2.STAFF_SHIFT AS 'SHIFT2' ,
S2.START_TIME AS 'START2' ,
S3.STAFF_SHIFT AS 'SHIFT3' ,
S3.START_TIME AS 'START3' ,
FROM NURS N
outer join STAFF S1 ON S1.ANSOS_ID = N.ANSOS_ID and STAFF.STAFF_SHIFT = '1'
outer join STAFF S2 ON S2.ANSOS_ID = N.ANSOS_ID and STAFF.STAFF_SHIFT = '2'
outer join STAFF S3 ON S3.ANSOS_ID = N.ANSOS_ID and STAFF.STAFF_SHIFT = '3'
I dont get it...that is the table name