Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's to like about a datetime
Message
From
30/08/2018 07:50:14
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
29/08/2018 19:48:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
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:
01661779
Views:
51
>>>>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.

Did not use an index, that's how I understand it.

The index is probably on some form of bintoc(dayinteger)+bintoc(millisecondsinteger), but probably without any conversion - just take those 8 bytes as a string and it should sort correctly because it never contains negative numbers.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform