Re: ORA-01840: input value not long enough for date format

From: Jasper Scholten <jasc27054_at_NO-SPAM.yahoo.co.uk>
Date: Sun, 16 Nov 2003 08:58:09 +0100
Message-ID: <3fb72e0a$0$58699$e4fe514c_at_news.xs4all.nl>


Tim,

If you write select statements as you did here, you will get into trouble with your code in the near future.

Anyway, try:

SELECT *
FROM tiger.view_tnw_mainstream
WHERE trunc(due_date-5) = trunc(sysdate)

It is expected that column DUE_DATE is a date column.

HTH,

-- 
Jasper Scholten
DBA / Application Manager / Systems Engineer


"ck388" <google_at_timyee.com> schreef in bericht
news:698a71bb.0311151753.219432b1_at_posting.google.com...

> I'm trying to perform a select query on an oracle database but I get
> this error.
>
> ORA-01840: input value not long enough for date format
>
> My query is:
>
> SELECT * FROM TIGER.VIEW_TNW_MAINSTREAM WHERE
> TO_CHAR(SYSDATE,'yyyy/mm/dd') =
> TO_CHAR(TO_DATE(DUE_DATE,'yyyy/mm/dd')-5,'yyyy/mm/dd')
>
> Does anyone know what's wrong?
>
> When I do:
>
> SELECT TO_CHAR(SYSDATE,'yyyy/mm/dd') FROM TIGER.VIEW_TNW_MAINSTREAM
>
> and
>
> SELECT TO_CHAR(TO_DATE(DUE_DATE,'yyyy/mm/dd')-5,'yyyy/mm/dd') FROM
> TIGER.VIEW_TNW_MAINSTREAM
>
> i get no errors.
>
> Would it be the fact that I have NULL values in the DUE_DATE field?
>
> Thanks in advance for any help.
>
> Tim :-)
Received on Sun Nov 16 2003 - 08:58:09 CET

Original text of this message