COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: cognos2014 on 01 Oct 2014 11:17:28 AM

Title: ORA-08161 Error using a date prompt
Post by: cognos2014 on 01 Oct 2014 11:17:28 AM
My report uses the date prompt for the below query. However I get an ORA-01861: literal does not match format string error message. My 'time__out' field is a combination of date and timestamp hence the trunc.

trunc(time_out) between to_date(#prompt('Parm_Start_Date')#,'YYYY-MM-DD' ) and to_date(#prompt('Parm_End_Date')#,'YYYY-MM-DD' )

Help please since I have tried all possible options trying to figure this out!

Thanks
Title: Re: ORA-08161 Error using a date prompt
Post by: MFGF on 01 Oct 2014 11:37:00 AM
Quote from: sinrag2005 on 01 Oct 2014 11:17:28 AM
My report uses the date prompt for the below query. However I get an ORA-01861: literal does not match format string error message. My 'time__out' field is a combination of date and timestamp hence the trunc.

trunc(time_out) between to_date(#prompt('Parm_Start_Date')#,'YYYY-MM-DD' ) and to_date(#prompt('Parm_End_Date')#,'YYYY-MM-DD' )

Help please since I have tried all possible options trying to figure this out!

Thanks

Hi,

Is there a reason for using prompt macros like this?  You could perhaps just try this as your filter expression:

[time-out] between ?Parm_Start_Date? and ?Parm_End_Date?

MF.
Title: Re: ORA-08161 Error using a date prompt
Post by: cognos2014 on 01 Oct 2014 03:01:56 PM
Thanks for the response MF.

I am using a SQL query and want to restrict my rows in the SQL instead of doing on the query, hence the prompt macro. I also tried what you suggested and still get the error.

FYI.. my time_out is a date type filed and an example of how the data looks is (02/19/2014 1:15:00 PM)

Title: Re: ORA-08161 Error using a date prompt
Post by: hanfrie on 02 Oct 2014 10:44:58 AM
Hello sinrag2005,

What exactly are the values used for the two prompts that trigger the error?
What do you get when you change your prompt format string from 'YYYY-MM-DD' into 'YYYYMMDD', without the '-'?

Hanfrie