Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's to like about a datetime
Message
De
30/08/2018 07:50:14
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
29/08/2018 19:48:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MS SQL Server
Divers
Thread ID:
01661714
Message ID:
01661779
Vues:
52
>>>>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform