Wednesday 4 April 2018

SQL statement to select all rows from previous day.

SQL statement to select all rows from previous day.

Description:
In this example we explain that how to get records of Yesterday in SQL Server. Or SQL Query to get the Data from table which recorded Yesterday. Or how to get Yesterday’s inserted record in SQL Server. Or basic SQL query to select records added Yesterday in SQL Server. Or get all record created Last one Day in SQL Server. Or how to get Yesterday date or last One-day data in SQL Server. Or SQL query that returns records by date Yesterday.

So here we demonstrate that how to get Last Day/ Yesterday date data in SQL Server. Below is the SQL query that will retrieve all the records that are created Yesterday.
Query:

SELECT * FROM [dbo].[Order] WHERE  [Loading Date] =   dateadd(day,datediff(day,1,GETDATE()),0)


This entry was posted in :

0 comments:

Post a Comment