[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Not really a Ruby question, but...

Jeff Miller

5/28/2008 7:05:00 PM

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-....

2 Answers

Damjan Rems

5/29/2008 5:37:00 AM

0


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


by
TheR
--
Posted via http://www.ruby-....

Robert Klemme

5/29/2008 7:22:00 AM

0

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?

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.ht...

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

Cheers

robert


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