Suppose we need to convert to datetime a free text input field that contains a date which can come in more than one defined date format , for example
'15-03-05' or
'15/03/08'
or '15/03/2005'
or '03/15/2005'
This script converts the text to date, using case ,like and convert T-SQL operators , choosing the appropriate date format