>>I strongly recommend you to use Naomi's suggestion:
>>
>>select * from myTable where DateField >=@Today and DateField < @Tomorrow
>>
>>Because SQL Server keeps milliseconds also you may filter some records if you use this:
>>
>>select *
>> from myTable
>>where DateField >=@Today and DateField <= @TodayAtMidNight
>>
>>You may have this records:
>>01/01/2010 23:59:59.937 and that record will be filtered.
>
>I read and understand what Naomi said. I just wanted to cut short. Actually I used this way to get today:
>
>xfirstdate=Datetime(Year(Date()),Month(Date()),Day(Date())+1,0,0,0)
>xlastdate=Datetime(Year(Date()),Month(Date()),Day(Date())+1,0,0,0)-1
>
>Boris, You are a bit wrong. It's not 937, 997: I read about 997
http://www.karaszi.com/SQLServer/info_datetime.asp :))
>And a thing about your new photo. I cannot see your face at that photo. Maybe you have to zoom it.
:-)))
.937 is just a random number :-) I just want to show you that there is millisecond value that is stored in DateTime field.
I'll try to zoom the picture, but not now :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.