select * from table_1
PIVOT(MAX(Ptype) FOR [Dates] IN ([22/2/2010],[23/2/2010],[24/2/2010]))AS p
Is fine, but the column name
[Dates]
doesn't match the
[Date]
in your table above. Testing the table and the SQL works fine IF your column names match and the
[Dates]
column is text (I didn't try make it work with a "date" data type).