Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Oracle and datetime filter
Message
De
19/07/2004 17:07:34
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
Divers
Thread ID:
00925784
Message ID:
00925935
Vues:
22
Mark,

Couldn't you just parameterize the datetime variable in the query:
lc_custno = [123]
lt_date   = CTOT([07/01/2004]) &&watch strictdate for this sample or use {^2004-07-01 ::}

TEXT to lc_SQL TEXTMERGE NOSHOW PRETEXT 3  && you may not have pretext option
   SELECT *
      FROM MyOracle.Sales Sales
      WHERE Sales.customer = ?lc_custno
        AND Sales.OrderDate = ?lt_date
      ORDER BY Sales.OrderDate
ENDTEXT
*!* get rid of line returns [not needed in VFP9 BTW]
lc_SQL = STRTRAN(lc_SQL, CHR(13) + CHR(10), [ ])
nresult = SQLEXEC(myhandle, lc_SQL, 'myresults')
All the format casting etc seems to be taken care of when we do this against Oracle or any other backend for that matter.

Regards

j.R
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform