how to convert date into month number?

后端 未结 7 1764
闹比i
闹比i 2021-01-19 14:40

I have a column Month in my table. The month name and date are stored in this month column like

Month    
01-JAN-12 
02-FEB-12 


        
相关标签:
7条回答
  • 2021-01-19 15:00

    datepart function do this easily

    SELECT DATEPART(m, getdate()) 
    
    0 讨论(0)
提交回复
热议问题