I have found a couple of different methods to convert it. However, I still get the
. I am currently using SQL Server 2014.
SELECT dateadd(day, convert(int, getdate()), 112)
SELECT DATEADD(YEAR, -2, convert(DATE, GETDATE(), 112))
It would be nice if you guys can help me out because this is pretty urgent for me.
Thanks a lot guys for the quick reply. So right now I am doing a date range of 2 years. Thus I need the codes to the find the date two years back.