Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oracle and datetime filter
Message
From
19/07/2004 17:07:34
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00925784
Message ID:
00925935
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform