Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL Date query problem is causing error with to_date.

SQL Date query problem is causing error with to_date.

From: Kal <kalgill_at_talk21.com>
Date: 13 Apr 2005 09:58:20 -0700
Message-ID: <ec0f1d86.0504130858.353a07af@posting.google.com>


Hi All,

I have an SQL problem with a date field, I am trying to pull Per_Id and Per_Birth_Date (Person Id and Person Birth Date), I am using the sql below:

SELECT Per_Id, Per_Birth_Date
FROM Oss_Persons
WHERE Per_Birth_Date >= to_date('01-APR-1980', 'DD-MON-YYYY');

I recieve the error:

ORA-01830: date format picture ends before converting entire input string

However if I used the to_date function on other date fields it works correctly, it's only on Per_Birth_Date there is a problem.

I am working on a client site so cannot alter the structure of the DB or how the date is stored.

Just doing a select of the Per_Birth_Date produces the date in format for example purposes:

01-APR-1976
05-APR-2002 The oracle environment I am using is:
Oracle7 Server Release 7.3.3.0.0 - Production Release

I think maybe possibly the date is stored as a varchar. I have tried everything I can think of manipulating the date converting it using to_char with to_date.

Can someone provide some assistance please?

Kind Regards,

Kal Received on Wed Apr 13 2005 - 11:58:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US