Wednesday, 21 March 2018

SQL Query to Get Next month record in SQL Server

SQL Query to Get Next month record in SQL Server

Description:


In this example we explain that how to get records of Next month using SQL Server. Or SQL Query to get the Next Month record in SQL Server. Or SQL Query to return all records from Next month using SQL Server. Or SQL query to select all records created in Next or upcoming Next month. Or how to retrieve Next month date values in SQL Server.

So here we demonstrate that how to get records of the Next or Upcoming month using SQL Server.

Query:

SELECT *
FROM [dbo].[Order]
WHERE DATEPART(m, [Loading Date]) = DATEPART(m, DATEADD(m, +1, getdate())) AND DATEPART(yyyy, [Loading Date]) = DATEPART(yyyy, DATEADD(m, +1, getdate()))



This entry was posted in :

0 comments:

Post a Comment