Thursday, August 18, 2011

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

Error Description:

I have executed one select query which compares date column for which I recieved the below error



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



Query:



select * from temp where to_date(substr(tokenvalue,1,10),'dd/mm/yyyy')>=

to_date('25/05/2011','dd/mm/yyyy')



Analysis:

Here the token value was having date data in different formats like

'08/25/2011',

'8/25/2011|'

which when passed to the to_date function results to this error as the second value doesnt satisfies correct format.



to_date(tokenvalue,'dd/mm/yyyy')



Solution:



Remove those bad data ('8/25/2011|')and run

this query against valid token values. You will get the correct output.



****Happy CoDiNg!!****



No comments:

Post a Comment