Home Forums SQL Server 2008 SQL Server Newbies convert month name to month number RE: convert month name to month number
Johnson Welch
SSCoach
Points: 18773
More actions
February 17, 2017 at 1:40 am
#1929042
you can simply do this by below code:declare @table table ( dated varchar(50) ) insert into @table values('2017-feb-16') select * from @table select datepart(mm,dated) from @table
declare @table table ( dated varchar(50) )
insert into @table values('2017-feb-16')
select * from @table
select datepart(mm,dated) from @table