Convert date not working
i am trying to format a date returns to dd/mm/yy
the sql statement i have is
SELECT ProjectPanelID,
Case DecisionBy When 'Board' THEN DateOfBoard
When 'Panel' THEN DateOfPanel
END As DecisionDate
FROM PROJECTPANEL
Which works fine but returns the date AND time, and I just want the date in a particular format.
So I tried this
SELECT ProjectPanelID,
CONVERT(VARCHAR(10), Case DecisionBy
When 'Board' THEN DateOfBoard
When 'Panel' THEN DateOfPanel
END As DecisionDate, 101) AS [MM/DD/YYYY]
FROM PROJECTPANEL
but now I keeping getting Incorrect syntax near the keyword 'As'.
can anyone help?
many Thanks
|