Hi Everyone,
I want to get the date from table so i used between and operator, it's working but it should get only in-between dates.... I want to get the from date till to date....Example:
Due Date
01/04/2012
02/04/2012
03/04/2012
04/04/2012
05/04/2012
if i used between and operators:
select * from tbl_name where Due Date between '02/04/1987' and '04/04/2012'...
Here only i got this O/P:
03/04/2012
04/04/2012... but i want to get
02/04/1987
03/04/2012
04/04/2012... This only i need....Just tell the solution...
Thanks In Advanced
How to get the values by using BETWEEN AND Operator
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Keyur Narkhi62 reputationPosted Apr 8, 2012, 9:44 PM EDT
The start date not comes because that not in your table data.
you need to prepand the start date to your output.
thanks
Keyur Narkhi62 reputationPosted Apr 8, 2012, 10:05 PM EDT
You can use something like that,
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SET @StartDate = '02/04/1924'
SET @EndDate = '04/04/2012'
SELECT OrderDate FROM Orders WHERE OrderDate BETWEEN @StartDate AND @EndDate
UNION
SELECT @StartDate
thanks