COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: mixim on 22 Oct 2014 12:25:05 PM

Title: Noob Question: Date to String
Post by: mixim on 22 Oct 2014 12:25:05 PM
Hi Guys, I know this question has been beaten to death before. But either which way. Have not been able to work it out.
I have a date-time column, which I would like to convert into char.

The reason is that I want to create grouping on the specific day of the date. Not the hour/minute.

1. So one alternative is to convert it from date/time to date.

2. Otherwise also just to convert it to string. where I would remove the time by 'YYYY-MM-DD'.


I have tried to use to_char([ITEM], 'YYYY-MM-DD'), but i get an error:
general exception has occurred during the operation "open result".ORA-01861: literal does not match format string
Title: Re: Noob Question: Date to String
Post by: mixim on 22 Oct 2014 12:31:28 PM
Solved by: cast([Date Item], date)

Still curious to why it didnt work in the beginning
Title: Re: Noob Question: Date to String
Post by: cognostechie on 22 Oct 2014 02:13:52 PM
because to_char is an Oracle function which could be recognized by Cognos.