Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's to like about a datetime
Message
De
06/09/2018 04:17:27
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/09/2018 16:04:13
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
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:
01661844
Vues:
67
>>>A LIKE search do benefit from an index on a date\datetime\datetime2\datetimeoffset column.
>
>If you're right re datetime which is what the thread is about, I'm very surprised since datetime is not stored as a string by SQL Server. i understood that LIKE on anything except a string, must involve implicit CAST to string that won't benefit from an index in a different format. But as I said earlier, I don't see how LIKE does anything for datetime you can't do with standard conditions, so I'm happy to leave it there.
>
>>>Mind you, you cannot use BETWEEN queries for datetime range searches in MS SQL server.
>
>So I must by lying that I've been doing it since last century? Along with quite a few others who also describe doing this online? Whatever, Cetin.

There IS an implicit casting. But having an implicit cast doesn't mean that an index wouldn't be used (I think you were thinking VFP tables).
About BETWEEN, I didn't say you are lying, just maybe you weren't aware of that your searches were returning results (correct?) just by chance. I have demonstrated that a zillion times here and elsewhere. With BETWEEN range boundaries are INCLUSIVE and with MS SQL server datetimes there is no way to create an INCLUSIVE upper bound.
Ç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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform