Hello
I am working on transations table that logs staff appointments.
There can be three appointments (AP1, AP2, AP3) and termination.
Each appointment has a date.
My objective is to physically convert Staff Rows into columns in the the table e.g.
Staff Appointment1 Date1 Successful1
John AP1 12/01/2011 No
John AP2 12/02/2011 No
John AP3 15/02/2011 No
John Termination 16/02/2011 Yes
I need to convert to table like this
Staff Appointment1 Date1 Successful1 Appointment2 Date2 Successful2 Appointment3 Date3 Successful3 Termination
I have googled and found the beginning of solution on MSDN. In general, it suggests using PIVOT table. Pivot tables creates columns for appointments and termination; however, dates are missing.
Please advise
I am working on transations table that logs staff appointments.
There can be three appointments (AP1, AP2, AP3) and termination.
Each appointment has a date.
My objective is to physically convert Staff Rows into columns in the the table e.g.
Staff Appointment1 Date1 Successful1
John AP1 12/01/2011 No
John AP2 12/02/2011 No
John AP3 15/02/2011 No
John Termination 16/02/2011 Yes
I need to convert to table like this
Staff Appointment1 Date1 Successful1 Appointment2 Date2 Successful2 Appointment3 Date3 Successful3 Termination
I have googled and found the beginning of solution on MSDN. In general, it suggests using PIVOT table. Pivot tables creates columns for appointments and termination; however, dates are missing.
Please advise