Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server DateTime in SQL Select
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01463837
Message ID:
01463889
Views:
32
You still do not understand the problem. Only records from '2010-05-01' with midnight time will be included. The rest will be ignored.

>Yes, I realize that 00 time is none-existing. It was just a typo; the actual value will have the time of 12:00:00. And it works, so far, in my tests. But I am thinking of changing the code in the 3P tool I am using and use only the date part.
>
>Thank you.
>
>>If datetime values stores with time part than it'll affect you. You do realize that
>>
>>TableName.FieldName between '2010-04-01 00:00:00' and '2010-05-01 00:00:00'
>>
will ignore all records for '2010-05-01' with none-zero time?
>>
>>
>>>Thank you for the explanation. I sort of have to use the BETWEEN since this is the syntax used in a 3P tool I am using. And since I am only concerned about comparing dates and not times, maybe the the fact that BETWEEN does not handle time part properly won't affect me. Or maybe I will take the time and change the 3P tool (I have the source code).
>>>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform