COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: billylodz on 16 Sep 2009 06:56:30 AM

Title: _add_days function
Post by: billylodz on 16 Sep 2009 06:56:30 AM
have you ever seen something like that

RS 8.3

every run this expresion gives different result, do you have any idea, seems it's problem when using  (_add_days + cast) together


_add_days ( cast('2009-01-01',DATE), 1 )
Title: Re: _add_days function
Post by: thrishul on 24 Sep 2009 06:01:15 AM
did you check in 8.2

its working fine!
Title: Re: _add_days function
Post by: Suraj on 28 Sep 2009 01:06:49 PM
8.3.
It gives a different date than expected with that combination and syntax. That's not what I expected.

But, your combination of cast and _add_days works if you remove the single quotes around the date:
_add_days ( cast(2009-01-01,DATE), 1 )
Title: Re: _add_days function
Post by: billylodz on 29 Sep 2009 01:56:40 AM
Thanks for input

In fact in my case the date was string because was taken from otherstring combinations, but it works also with _make_timestamp


something like:
_add_days(CAST(_make_timestamp(2009,09,16),DATE),1)
where 2009,09,16 I take from string

Thanks