Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oracle and datetime filter
Message
From
19/07/2004 11:37:46
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Oracle and datetime filter
Miscellaneous
Thread ID:
00925784
Message ID:
00925784
Views:
82
I am trying to query an Oracle table. The following works fine except when I try to add a where clause for the OrderDate field.

What would be the proper way to query this Oracle table with a where clause on the OrderDate (datetime) field?

***This works without the OrderDate clause.
lc_custno = [123]
lc_sql = [SELECT * ] + ;
[FROM MyOracle.Sales Sales ] + ;
[WHERE Sales.customer = '] + lc_custno + [' ] + ;
[ORDER BY Sales.OrderDate]
nresult = SQLEXEC(myhandle, lc_sql, 'myresults')

***This does not work and the nresult = -1.
lc_custno = [123]
lc_date = [07/01/2004 12:00:00 AM]
lc_sql = [SELECT * ] + ;
[FROM MyOracle.Sales Sales ] + ;
[WHERE Sales.customer = '] + lc_custno + [' ] + ;
[AND Sales.OrderDate >= '] + lc_date + [' ] + ;
[ORDER BY Sales.OrderDate]
nresult = SQLEXEC(myhandle, lc_sql, 'myresults')

How can I filter a datetime field in a Oracle SQL call?

Thanks,

Jerry
Next
Reply
Map
View

Click here to load this message in the networking platform