dbTalk Databases Forums  

simple select statement problem

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss simple select statement problem in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
maunicar@gmail.com
 
Posts: n/a

Default simple select statement problem - 04-30-2009 , 09:33 AM






Hi M/S:

Here I am selecting simple statement but I am getting ora01722 error.
Can somebory please help me on this.
Thanks in advance.
Manchi.

select io.accession,
to_date(io.date_ordered, 'yyyy-mm-dd hh24:mi:ss') ACCESSION_KEY
from instrument_orders io
where to_char(io.date_ordered, 'yyyy-dd-mm hh24:mi:ss') > to_char
('2009-01-04' , 'yyyy-dd-mm');

Reply With Quote
  #2  
Old   
maunicar@gmail.com
 
Posts: n/a

Default Re: simple select statement problem - 04-30-2009 , 09:35 AM






On Apr 30, 9:33*am, mauni... (AT) gmail (DOT) com wrote:
Quote:
Hi M/S:

Here I am selecting simple statement but I am getting ora01722 error.
Can somebory please help me on this.
Thanks in advance.
Manchi.

select io.accession,
to_date(io.date_ordered, 'yyyy-mm-dd hh24:mi:ss') ACCESSION_KEY
from instrument_orders io
where to_char(io.date_ordered, 'yyyy-dd-mm hh24:mi:ss') > to_char
('2009-01-04' , 'yyyy-dd-mm');
even I tried with
select io.accession,
to_char(io.date_ordered, 'yyyy-mm-dd hh24:mi:ss') ACCESSION_KEY
from instrument_orders io
where to_char(io.date_ordered, 'yyyy-dd-mm hh24:mi:ss') > to_date
('2009-01-04' , 'yyyy-dd-mm');
same error.
Thanks,
M.




Reply With Quote
  #3  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: simple select statement problem - 04-30-2009 , 10:17 AM



maunicar (AT) gmail (DOT) com escribió:
Quote:
Here I am selecting simple statement but I am getting ora01722 error.
Can somebory please help me on this.
Thanks in advance.
Manchi.

select io.accession,
to_date(io.date_ordered, 'yyyy-mm-dd hh24:mi:ss') ACCESSION_KEY
from instrument_orders io
where to_char(io.date_ordered, 'yyyy-dd-mm hh24:mi:ss') > to_char
('2009-01-04' , 'yyyy-dd-mm');
to_date(io.date_ordered, 'yyyy-mm-dd hh24:mi:ss')
to_char(io.date_ordered, 'yyyy-dd-mm hh24:mi:ss')

One of these must be wrong. What's "io.date_ordered", a DATE or a VARCHAR2?



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--


Reply With Quote
  #4  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: simple select statement problem - 04-30-2009 , 10:20 AM



maunicar (AT) gmail (DOT) com escribió:
Quote:
select io.accession,
to_date(io.date_ordered, 'yyyy-mm-dd hh24:mi:ss') ACCESSION_KEY
from instrument_orders io
where to_char(io.date_ordered, 'yyyy-dd-mm hh24:mi:ss') > to_char
('2009-01-04' , 'yyyy-dd-mm');

even I tried with
select io.accession,
to_char(io.date_ordered, 'yyyy-mm-dd hh24:mi:ss') ACCESSION_KEY
from instrument_orders io
where to_char(io.date_ordered, 'yyyy-dd-mm hh24:mi:ss') > to_date
('2009-01-04' , 'yyyy-dd-mm');
Sorry, I hadn't noticed this other message.

You are doing TO_CHAR(...)>TO_DATE(...). Again, what data type is
"io.date_ordered"?


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.