Get current year in TSQL

前端 未结 2 777
無奈伤痛
無奈伤痛 2021-02-12 07:29

I have data I am trying to pull for a report and I am working on a Year to Date report. My columns in the table are formatted as datetime. I am trying to run a select statement

2条回答
  •  情话喂你
    2021-02-12 08:13

    Yes, it's remarkably easy in fact:

    WHERE YEAR(A.[reimbursementDate]) = YEAR(GETDATE())
    

提交回复
热议问题