I am trying to use BETWEEN to return records for a specific day.
I have no issues when the two date values are different.
My issue is when using a date of the same value.
What I want to do is append 00:00:00.000 to the start date, and
99:99:99.999 to the end date.
This sample sql code reads in two date values from an external application. It is possible that someone will want to return all records for a single day.
Hope this makes sense...
declare @a char(10) = null
declare @b char(10) = null
set @a = '2/27/2013'
set @b = '2/27/2013'
select * from MYTABLE dsh
where dsh.aDate between convert(datetime, @a, 121) and convert(datetime, @b, 121)