From 096ac77c1f7e65c9bda8256c91dfd06072083e91 Mon Sep 17 00:00:00 2001 From: Sandeep Singh <55851630+Sandeep-BlackHat@users.noreply.github.com> Date: Fri, 4 Sep 2020 23:57:28 +0530 Subject: [PATCH] BETWEEN Dates Example The following SQL statement selects all orders with an OrderDate BETWEEN '01-July-1996' and '31-July-1996':/* SELECT * FROM Orders WHERE OrderDate BETWEEN #01/07/1996# AND #31/07/1996#; /*OR:*/ SELECT * FROM Orders WHERE OrderDate BETWEEN '1996-07-01' AND '1996-07-31'; --- C0de5/Programs_2.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/C0de5/Programs_2.sql b/C0de5/Programs_2.sql index eaa1e68..1dbf5e7 100644 --- a/C0de5/Programs_2.sql +++ b/C0de5/Programs_2.sql @@ -39,3 +39,14 @@ The following SQL statement selects all products with a ProductName NOT BETWEEN SELECT * FROM Products WHERE ProductName NOT BETWEEN 'Carnarvon Tigers' AND 'Mozzarella di Giovanni' ORDER BY ProductName; + +/*BETWEEN Dates Example +The following SQL statement selects all orders with an OrderDate BETWEEN '01-July-1996' and '31-July-1996':/* + +SELECT * FROM Orders +WHERE OrderDate BETWEEN #01/07/1996# AND #31/07/1996#; + +/*OR:*/ + +SELECT * FROM Orders +WHERE OrderDate BETWEEN '1996-07-01' AND '1996-07-31';