how to get the number on months between two dates in sql server 2005

前端 未结 4 1766
余生分开走
余生分开走 2021-01-13 08:49

I have a column in my sql server 2005 table that should hold the number of months an employee has been in service.

Since I also have the date the employee was engage

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-13 09:18

    If You presume that month is meaning for 30 days You can also round vale

    round((datediff(day,[DateEngaged],getdate()))/30.00,0)
    

提交回复
热议问题