Was wondering what would be the most efficient way to get data from today, does converting the date something like
WHERE CONVERT(CHAR(8),[DateTimeColumn],112) = CONVERT(CHAR(8),GETDATE(),112)
Not slow down the process as SQL essentially has to do a RBAR compare? Any thoughts or suggestions?
Please note that the column is datetime and it contains record insert date and time
datetime, you can useWHERE CAST(DateColumn AS DATE) = CAST(GETDATE() AS DATE)for 2008+. ButWHERE DateColumn >= CAST(GETDATE() AS DATE) AND DateColumn < DATEADD(day, 1, CAST(GETDATE() AS DATE))should work for any version and can use an index. – ypercubeᵀᴹ Dec 09 '14 at 11:53datetype so it would only work with 2008+). For 2000 or 2005, the stripping of the time must be done differently.) – ypercubeᵀᴹ Dec 09 '14 at 12:28