ORA-01839 [message #640] |
Mon, 25 February 2002 09:44 |
VĂctor
Messages: 17 Registered: October 2001
|
Junior Member |
|
|
I have this query:
select distinct emplid,BIRTHDATE,
TO_DATE((TO_CHAR(SYSDATE,'YYYY')||TO_CHAR(BIRTHDATE,'MMDD')),'YYYYMMDD')
FROM PS_PERSONAL_DATA C
WHERE BIRTHDATE IS NOT NULL
and TO_DATE((TO_CHAR(SYSDATE,'YYYY')||TO_CHAR(BIRTHDATE,'MMDD')),'YYYYMMDD') BETWEEN SYSDATE-30 and (SYSDATE)
birthdate is of date type.
I get the message error ORA-01839 date not valid for month specified. I can avoid this by removing the DISTINCT clause but i need it. please help, thanks
|
|
|
Re: ORA-01839 [message #655 is a reply to message #640] |
Tue, 26 February 2002 01:57 |
pratap kumar tripathy
Messages: 660 Registered: January 2002
|
Senior Member |
|
|
the problem is not in distinct . i tried your query here and it is fine.
problem is with your data.
-----------------------
ORA-01839 date not valid for month specified
Cause:
The day of the month specified in the date is invalid for the given month. The day of the month (DD) must be between 1 and the number of days in the month.
Action:
Enter a valid day of the month for the specified month.
|
|
|