I am receiving as a parameter a date, this date is in the format 04/24/2012, so in sql i need to be able to do something like
SELECT *
FROM MYTABLE
WHERE OrderDate BETWEEN (04/24/2012 at 12 am (StartDate))
AND (04/24/2012 at 11:59 pm (EndDate))
I have two parameters StartDate and EndDate
@StartDate nvarchar(50),
@EndDate nvarchar(50),
Sometimes StartDate and EndDate are not the same date so it could be 4/24/2012 – 4/27/2012, this is working fine… the problem is when they are doing the same day.
Try using end date but doing
This way includes all the time between startdate and enddate if they are on the same day. E.g. greater or equal to the start of the day but less than the start of the next day