2
I want to get some date 60 months ago.
I’m in a project that shows only the files sent 60 months, but it’s 60 months and not 5 years, maybe it doesn’t make any difference.
Any idea? I tried using Datediff, but I’m unsuccessful. I want to do this in SQL Procedure
SELECT CAST(DATEPART(YY, GETDATE()) - 5 AS VARCHAR)
Note that the "5" before the varchar, refers to the 60 months or 5 years, however, it wants 60 months. How could I catch this date from 60 months ago.
Post the code you tried with
datediff
.– Franchesco