Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Usability of date syntax in SQL
Message
De
10/04/2003 00:50:49
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Usability of date syntax in SQL
Divers
Thread ID:
00775883
Message ID:
00775883
Vues:
42
On some occasions, I have the need to incorporate in my SQL the value of the numeric field as is. For example, if I have a lnYear value of 1999 and that I am building a lcSQL string, I would do as is:
lcSQL='SELECT Numero FROM News WHERE Year='+ALLTRIM(STR(lnYear))
&lcSQL
So, this allows me to pass lcSQL as a parameter and have it working in another method. Otherwise, if I would do:
lcSQL='SELECT Numero FROM News WHERE Year=lnYear
&lcSQL
I would need to have lnYear visible in the method.

My question is how can I achieve the same with a date? I want to be optimizable and if I use:
lcSQL='SELECT Numero FROM News WHERE StartDate=CTOD('01/01/1999')
&lcSQL
This won't be.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform