I have a field say dat_val in the table of type char. The dates are stored in two different formats as of now. ie yyyy-mm-dd and mm-dd-yyyy. I am having problem writing a function to extract the Year from this string field. The function should be able to extract year anywhere in the string along with the above two formats, say mm-yyyy-dd!