I have a start_date
and end_date
. I want to get the list of dates in between these two dates. Can anyone help me pointing the mistake in my query.
select Date,TotalAllowance
from Calculation
where EmployeeId=1
and Date between 2011/02/25 and 2011/02/27
Here Date
is a datetime
variable.
You ca try this SQL
best query for the select date between current date and back three days:
best query for the select date between current date and next three days:
Try putting the dates between # # for example:
It worked for me.
--- EDIT --- I received a notification that I lost two reputation points because somebody down-voted this answer. Please, don't just down-vote if the answer doesn't work for You. Ask for further info/help in the comments, or check other solutions.
I don't care about reputation points - I just say that down-votes are not made for that.
I like to use the syntax '1 MonthName 2015' for dates ex:
for dates
This query stands good for fetching the values between current date and its next 3 dates
This will eventually add extra 3 days of buffer to the current date.
-- if data type is different