date works only from 2008 onwards. you dont need the casting there. just do
WHERE datefield >= DATEADD(dd,DATEDIFF(dd,0,GETDATE()),-1)
AND datefield < DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0)
see
http://visakhm.blogspot.in/2012/12/different-ways-to-implement-date-range.html
http://visakhm.blogspot.in/2012/07/generate-datetime-values-from-integers.html
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/