Monday, 26 March 2018

SQL Query to Get records of Last week using SQL Server

SQL Query to Get records of Last week using SQL Server

Description:


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

Here we demonstrate that how Select Last one week records from today’s date.or how to get Last week data during anytime in this week.
Query:

SELECT *
FROM [dbo].[Order] WHERE  [Loading Date] >=  dateadd(wk, datediff(wk, 0, getdate()) - 1, 0)  and  [Loading Date] < dateadd(wk, datediff(wk, 0, getdate()), 0)









This entry was posted in :

0 comments:

Post a Comment