Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server DateTime in SQL Select
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01463837
Message ID:
01463845
Vues:
56
>I found that another syntax works, {ts 'YYYY-MM-DD 00:00:00'}. Do you see anything wrong with this?
>
>>SQL Server does not understand VFP datetime literals
>>
>>TableName.FieldName >= '2010-04-01' and TableName.FieldName < '2010-05-02'
>>
>>>

SQL Server dates are included in '' (single quotes).

BTW, the best way is to use ISO dates, so the best way to write the above (apart from using parameters - this would be the best):
TableName.FieldName >= '20100401' and TableName.FieldName < '20100502'
Why it is always the best idea to use ISO dates is covered in the Aaron Bertrand's blog I gave you link in my other message.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform