Current month and year in SQL Server 2008 r2

I am currently new to C # and SQL.

How to get the current month and year in SQL Server 2008 R2?

+6
source share
1 answer

SQL Server

SELECT GETDATE() AS CurrentDateTime , YEAR(GETDATE()) AS CurrentYear , MONTH(GETDATE()) AS CurrentMonth 

WITH#

 var now = DateTime.Now; var currentYear = now.Year; var currentMonth = now.Month; 
+24
source

Source: https://habr.com/ru/post/943443/


All Articles