I am trying to convert dates (stored as nvarchar) into datetime but I'm having problems due to different date formats used to store the data currently.The dates are currently either stored as..Nulldd/mm/yy (8 chars)dd/mm/yyyy (10 chars)d/mm/yyyy (9 chars)The code I have at the moment can convert the 8 and 10 char length dates but I don't know how to use nested CASE statements if it's possible to conver the 9 char version.Current code:SELECTCASE WHEN LEN(c.DatePurchased) = 8 THEN CONVERT(datetime, LEFT(c.DatePurchased,6) + '20' + RIGHT(c.DatePurchased,2) , 103) ELSE CONVERT(datetime, ISNULL(c.DatePurchased,'21/03/2002'), 103)END AS WhenAdded,FROM [CD Catalogue] c