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

Popular posts from this blog

cron - how to properly run Python script with crontab on every system startup -

elasticsearch - Is the order of operations guaranteed in a bulk update? -

Slow performance first queries on SQL Azure -