I'm trying to capture the datepart from an filename and trying to convert it to datetime datatype.
SELECT CONVERT(Datetime, substring('EmployeeExcel_03312013',15,22), 120)
Getting below error:
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Any ideas? Please suggest if I am missing anything?