I have a legacy application where the input is a date string, i.e.:
06/12/2009
The format of the input is always a string, and i
I agree with the advice from spencer7593, but please be aware that using cast or convert without a format can give unexpected results. This T-SQL query returns 12, not 1.
set language British select month(CAST('2016-01-12' AS datetime))