SQLTeam.com | Weblogs | Forums

Convert JAN-18 to january or 1 and so on


#1

convert JAN-18 to january or 1 and so on


#2
select convert(datetime, '1-' + 'jan-18')

#3

DECLARE @date date
SET @date = '18-Jan-2018'
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, @date), 0)