First of all, use Tim Biegeleisen's answer unless you have a very good reason. The PIVOT clause takes almost as much code as the MAX(CASE....) version but is harder to write and read.
And I can never remember the syntax. I always have to look it up.
Using PIVOT, you need to
SELECT ID,
[1] as Step_1,
[2] as Step_2
FROM
(
SELECT ID,Date,Step
FROM yourTable
) AS SourceTable
PIVOT
(
MAX(Date)
FOR Step IN ([1], [2])
) AS PivotTable;
In SQL you can't have an arbitrary number of columns, or multiple values per column. The PIVOT clause identifies the Step values that become columns and the aggregate function used to reduce potentially multiple "cell" values into a single one.
Compare this with this equivalent:
SELECT ID,
MAX(CASE WHEN STEP = 1 THEN Date END) AS Step_1,
MAX(CASE WHEN STEP = 2 THEN Date END) AS Step_2
FROM yourTable
GROUP BY ID
ORDER BY ID;
Which one is clearer?
What if you decide to use different aggregate functions per step?
SELECT ID,
MIN(CASE WHEN STEP = 1 THEN Date END) AS Step_1,
MAX(CASE WHEN STEP = 2 THEN Date END) AS Step_2
FROM yourTable
GROUP BY ID
ORDER BY ID;