USE Northwind
DECLARE @PrevDate AS DateTime
SET @PrevDate = '1996-08-15'
SELECT OrderID, CustomerID, EmployeeID, OrderDate
FROM ORDERS
WHERE OrderDate < Cast(Convert(varchar,@PrevDate,101) as datetime)
and OrderDate >= Cast(Convert(varchar,@PrevDate,101) as datetime) - 1
Results:
10280 BERGS 2 1996-08-14 00:00:00.000
10281 ROMEY 4 1996-08-14 00:00:00.000
No comments:
Post a Comment