How to Extract Month and year from SYSDATETIME :
Pass from "2019-04-26 12:13:52.1683125" TO "201904"
Then Convert "201904" to INT.
How to Extract Month and year from SYSDATETIME :
Pass from "2019-04-26 12:13:52.1683125" TO "201904"
Then Convert "201904" to INT.
If you are using SQL server as Database then below script should work for you
SELECT CAST(YEAR(getdate()) AS VARCHAR)+ RIGHT('00'+CAST(MONTH(getdate()) AS VARCHAR),2)
If you want a numeric representation of the date as YYYYMM in SQL Server, I would recommend:
select year(getdate()) * 100 + month(getdate())
You can use sysdatetime()
if you prefer.