Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's to like about a datetime
Message
From
29/08/2018 19:48:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/08/2018 16:19:17
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MS SQL Server
Miscellaneous
Thread ID:
01661714
Message ID:
01661772
Views:
61
>>>DateTimes have always been problematic in searches if you don't treat them as strings. I will add this to that SO link.
>
>FWIW I've been querying DATETIME in SQL Server and Oracle for over 20 years. For datetime fields, initially a different string was assembled for each database matching a cast string value, until we realized that a datetime passed in a parameterized query via ODBC is automatically cast correctly AND uses the index on a datetime field, which casting to string often did not.
>
>My understanding is that datetime gets stored as 2 integers in SQL Server. Certainly it would be interesting to know what an index on that looks like.

I don't think your searches was for exact matches. Otherwise you would know that by now. MS SQL server datetime is only have a sensitivity of 3 milliseconds.

I don't understand what your comment "which casting to string often did not" means at all.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform