Luis Cazares - Friday, September 22, 2017 10:15 AM
I know you know this ol' friend and, although not applicable for this particular problem of YYYY-MM but for anyone watching, you only need one date part if the date part is year or two if the monthly date part is either the month name or a proper abbreviation of the month name
SELECT CONVERT(DATETIME,'2017')
,CONVERT(DATETIME,'MAR2017')
,CONVERT(DATETIME,'MAR 2017')
,CONVERT(DATETIME,'MARCH 2017')
,CONVERT(DATETIME,'2017Mar')
,CONVERT(DATETIME,'2017 Mar')
,CONVERT(DATETIME,'2017 March')
;
--Jeff Moden
Change is inevitable... Change for the better is not.