Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server DateTime in SQL Select
Message
 
 
To
09/05/2010 17:47:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01463837
Message ID:
01463897
Views:
48
>>>Don't worry. Using BETWEEN, SQL server doesn't have a problem with datetime values and it doesn't have a problem with the time portion either. It is VFP that does have a problem with time portion.
>>>Cetin
>>
>>Why do you say that? Please read carefully Aaron Bertrand's blog I gave in my other message.
>
>Because it is like that. I wouldn't read, it is a long writing. Would you instead tell me where does it say SQL server has problem using between with datetime values or it has a problem with the time portion.
>Cetin

If you have a datetime field in SQL Server and you want to ensure that time portion of the particular date is included in the result set, then the only way to select the information would be
select * from myTable where DateField >=@StartDay and DateField < @EndDay + 1
Otherwise there is a risk of losing some values due to time precision.

Aaron Bertrand's blog (short one) explains it very clearly - take a read, you would not regret.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform