COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: dri on 15 Apr 2016 04:54:21 PM

Title: Date Format in Cognos
Post by: dri on 15 Apr 2016 04:54:21 PM
I am need to change yyyy/mm/dd hh:mm:ss aa  to yyyy/mm/dd. And filter it like Data Item = Yesterday's date.

How can I do this?

I tired few options but I am getting An error occurred while performing operation 'sqlPrepareWithOptions' status='-126'. If I just check formula it shows no error.

Title: Re: Date Format in Cognos
Post by: HalfBloodPrince on 19 Apr 2016 07:59:50 AM
can you plz share the code you have written
Title: Re: Date Format in Cognos
Post by: dri on 19 Apr 2016 09:59:04 AM
Even if I just try to change format from list report, it won't change. Codes I used for dates work for different package but not for this package.

Would you know the possible problem.
Title: Re: Date Format in Cognos
Post by: Lynn on 19 Apr 2016 10:04:46 AM
Is it a relational or a dimensional package? If it is relational are you certain the field is a date time data type and not just a string that contains a formatted date and time value?

What method are you using to change the format? Is it an expression in the data item or the data format in the layout? Can you answer HalfBloodPrince and provide the details on what you are trying to implement? If you look at the details link for the error reported in your first post does it contain any further information?

You will have a better chance of getting good answers if you can provide more detail.
Title: Re: Date Format in Cognos
Post by: dri on 19 Apr 2016 10:40:36 AM
It is relational database. Datatype is Date-Time.

In list report, right click date column-style-data format-date. It works for other package not for this package.

While creating Data Item in query I tried many of possible codes, it did not work for this package while it worked for other package.
Simple code like (current_date - 1) does not work this package while it works for other package.


Title: Re: Date Format in Cognos
Post by: dri on 19 Apr 2016 10:42:32 AM
database is oracle.
Title: Re: Date Format in Cognos
Post by: chinnucognos on 21 Apr 2016 04:08:45 AM
If same coloumn with same table working fine in other FM models,then you should look into the FM model and see the Usage Porperty and data type for that particular date column.
or
else check the model which is working good and compare both models.