Description:
Query:
In this example
we explain that how to get records of current month using SQL Server. Or SQL
Query to get the This Month record in SQL Server. Or SQL Query to return all
records from current month using SQL Server. Or SQL query to select all records
created in current month. Or how to retrieve current month date values in SQL Server.
-- Get This month Record
SELECT *
FROM [dbo].[Orders]
WHERE
MONTH([OrderDate]) = MONTH(dateadd(dd, -1, GetDate()))
AND
YEAR([OrderDate]) = YEAR(dateadd(dd, -1, GetDate()))
0 comments:
Post a Comment