In SQL Server 2005, this is usually the fastest way to convert date and time to date:
DATEADD(day, DATEDIFF(day, 0, yourDate), 0)
In your case, this is done only once, so in reality it does not really matter. But he gives the following query.
Select
*
from
table1
where
tabledate >= DATEADD(day, DATEDIFF(day, 0, getDate()) - 1, 0)
AND tabledate < DATEADD(day, DATEDIFF(day, 0, getDate()), 0)
source
share