sql - Converting datetime variable format -
i need in converting datetime variable format mmm dd yyyy datetime variable format yyyy-mm-dd
i'm assuming datetime variable varchar
- can directly cast via convert
:
declare @yourvariable varchar (15) = 'jan 01 1996' select convert(date, @yourvariable)
1996-01-01
Comments
Post a Comment