Not really a Ruby question, but

Hello,
I'm using a Ruby script to grab some data from an Oracle database via
an ODBC connection. Everything works great, but I want to select a
certain date range when I query the database. However, the date is in a
different format, I think. The Oracle field type is "date". How would I
be able to format a date like 05/20/2008 so that I can compare it with
the date field in Oracle?

Thanks,
- Jeff Miller

···

--
Posted via http://www.ruby-forum.com/.

Maybe Time.now.strftime('%d/%m/%Y')

by
TheR

···

--
Posted via http://www.ruby-forum.com/.

select ...
from ...
where your_date >= TO_DATE('05/20/2008', 'MM/DD/YYYY')
and ...

see http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions183.htm#i1003589

Note, a good place to look for Oracle docs is http://tahiti.oracle.com

Cheers

robert

···

2008/5/28 Jeff Miller <loadeddesigns@gmail.com>:

Hello,
I'm using a Ruby script to grab some data from an Oracle database via
an ODBC connection. Everything works great, but I want to select a
certain date range when I query the database. However, the date is in a
different format, I think. The Oracle field type is "date". How would I
be able to format a date like 05/20/2008 so that I can compare it with
the date field in Oracle?

--
use.inject do |as, often| as.you_can - without end