How do I get last 3 months data in SQL Server?
How do I get last 3 months data in SQL Server? SELECT *FROM Employee WHERE JoiningDate >= DATEADD(M, -3, GETDATE()) SELECT *FROM Employee WHERE JoiningDate >= DATEADD(MONTH, -3, GETDATE()) DECLARE @D INT SET @D = 3 SELECT DATEADD(M, @D, GETDATE()) How do I subtract a month from a date in SQL? We can use DATEADD() […]