I am trying to extract the date from a string. I am using the below mentioned query using both SUBSTRING and PATINDEX:
SELECT Message, SUBSTRING(Message, PATINDEX('%[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]%', Message), 10) as Month_Captured
I am confused by the results "CONTROL V", please see the attached image. Can you please explain why this is happening and what is the best way to extract the date from a string.