COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: JuliaM on 18 Dec 2012 09:01:49 AM

Title: Concatination/trim
Post by: JuliaM on 18 Dec 2012 09:01:49 AM
Hi All,

I need help please!
I have a report where I show curernt month, next month and next month + 1 (Dec, Jan, Feb). I extract current month and year from sysdate, calculate next year, next month, convert form num to char and then concatinate into year+month to compare with DB values. However, after after concatination, I get '20131', not '201301' as I need.

Any suggestions?

Thank you!
Title: Re: Concatination/trim
Post by: RubenvdLinden on 18 Dec 2012 10:02:50 AM
Extract the year and multiply by 100, then extract the month and add (+) it to the result.

For example:
extract(YEAR; [Date]) * 100 + extract(MONTH; [Date])
Title: Re: Concatination/trim
Post by: JuliaM on 18 Dec 2012 11:09:46 AM
Thanks!