I using MS SQL Sever and I want to filter my query by only “today” registers, example
select * from tbl where [FieldDate] >= "Today Date"
I know I can use something like:
[FieldDate] >= DATEADD(DAY, 0, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP))
or
[FieldDate] >= CAST(FLOOR( CAST( GETDATE() AS FLOAT))AS DATETIME)
But, what is the best way to do that?, thanks a lot.
Note: I can’t use the “convert(date, getdate())”.
This should work:
For SQL Server 2005: