There's no need for the Date(...) as far as i can tell. This example seems to work
DECLARE @TheDate Date = '2012-07-01';
SELECT 'hello' WHERE (@TheDate BETWEEN '2012-04-01' AND '2012-06-30')
--None returned
SET @TheDate = '2012-05-01'
SELECT 'hello' WHERE (@TheDate BETWEEN '2012-04-01' AND '2012-06-30')
--selects hello
Edit Btw worth looking at This Question with the date time answer (will post here just to save effort)
The between statement can cause issues with range boundaries for dates as
BETWEEN '01/01/2009' AND '01/31/2009'
is really interpreted as
BETWEEN '01/01/2009 00:00:00' AND '01/31/2009 00:00:00'
so will miss anything that occurred during the day of Jan 31st. In this case, you will have to use:
myDate >= '01/01/2009 00:00:00' AND myDate < '02/01/2009 00:00:00' --CORRECT!
or
BETWEEN '01/01/2009 00:00:00' AND '01/31/2009 23:59:59' --WRONG! (see update!)
UPDATE: It is entirely possible to have records created within that last second of the day, with a datetime as late as 01/01/2009 23:59:59.997!!
For this reason, the BETWEEN (firstday) AND (lastday 23:59:59)
approach is not recommended.
Use the myDate >= (firstday) AND myDate < (Lastday+1)
approach instead.