I'm not sure but it may be better / easier / faster / simpler to do the comparison in the SQL:
Something like http://sqlfiddle.com/#!3/d2910/8/2
-- fiddle schema (LHS): create table t( d date ); -- fiddle SQL (RHS): insert into t values ( getdate() ) , ( getdate() + 1 ) ; -- t now contains 2 rows select * from t where d = cast(getdate() as date); -- returns only the one row
(Note that you have to cast the value as getdate returns a timestamp and not a date)
In reply to Re: sql datetime value with today
by erix
in thread sql datetime value with today
by fionbarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |