COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: srinu_anu2007 on 16 Aug 2012 05:09:56 AM

Title: Adding no of years with data item
Post by: srinu_anu2007 on 16 Aug 2012 05:09:56 AM
Hi
I want to add no of years with data item
like...([business layer].
Title: Re: Adding no of years with data item
Post by: HalfBloodPrince on 16 Aug 2012 06:39:57 AM
Pls try to give some more explanation about what data it contains in column y . Means its date 2012-08-16 or years like 2007.
65 years is what a calculation  or fixed value ??
Title: Re: Adding no of years with data item
Post by: ahmerzaidi on 16 Aug 2012 06:42:19 AM
Have you tried using the _add_years  function?

_add_years ( date_expression, integer_expression )
Returns the date or datetime, depending on the format of "date_expression", that results from the addition of "integer_expression" years to "date_expression".
Title: Re: Adding no of years with data item
Post by: srinu_anu2007 on 16 Aug 2012 07:14:43 AM
Quote from: HalfBloodPrince on 16 Aug 2012 06:39:57 AM
Pls try to give some more explanation about what data it contains in column y . Means its date 2012-08-16 or years like 2007.
65 years is what a calculation  or fixed value ??

in column y having date of birth which is formatted as mm/dd/yyy

65years is a fixed calculation.
Title: Re: Adding no of years with data item
Post by: HalfBloodPrince on 16 Aug 2012 07:27:04 AM
Try This
create a query Calculation as

_add_years ([Year],65)
then right click got to Style->data format -> Select date
then in the last property Pattern put MM/dd/YYYY