COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: S2000 on 09 Dec 2010 10:39:19 AM

Title: Month - using Cognos SQL only in Report Studio
Post by: S2000 on 09 Dec 2010 10:39:19 AM
I have a number of queries which feed each other and do various date calculations.
The end result of these is a date data item in a query.

From this I need to derive the month name.
Normally I'd just use a sql function for the datename({month}, Date) or a 12 part case statement;
When month(date) = 1 then 'Jan'
When month(date) = 2 then 'Feb'
...
And so on.


But, as this query is a child of another query I cannot use any SQL server functions.
"QueryReuse: the generated sql is not supported locally."

Does anyone know of any Cognos SQL functions that can help me with what I'm trying to do?
I can't just do this by formating it on the page, I need the month in the query.

Thanks in Advance.
Title: Re: Month - using Cognos SQL only in Report Studio
Post by: S2000 on 09 Dec 2010 11:01:09 AM
aha...
The Extract function is what I wanted.

Nothing to see here, move along. :)
Title: Re: Month - using Cognos SQL only in Report Studio
Post by: MFGF on 09 Dec 2010 12:01:33 PM
Lol - I do that all the time. Probably why I'm referred to as a muppet. :)

Thanks for the update - glad you found the solution.

MF.