COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: rr.bi1212 on 26 Mar 2012 03:27:52 PM

Title: Converting from datetime to int
Post by: rr.bi1212 on 26 Mar 2012 03:27:52 PM
how to replicate this filter in cognos
   birthDt + 56 <= Date Range
where birthDt is datetime and also tell me how should I put Daterange in that particular filter
Title: Re: Converting from datetime to int
Post by: Lynn on 26 Mar 2012 03:43:08 PM
You can't specify <= with a date range. It would need to be a specific date. A between operator would let you see if a date falls within a specified start and end.

Look at the _add_years function to add 56 to the birth date. Look at the _make_timestamp function to specify the value you want to compare.
Title: Re: Converting from datetime to int
Post by: rr.bi1212 on 26 Mar 2012 10:24:33 PM
Lynn,

I have tried all those things and it did not work
Title: Re: Converting from datetime to int
Post by: Lynn on 27 Mar 2012 07:12:31 AM
You'll need to provide some specifics. What didn't work? What was the expression syntax? Did you get an error or an incorrect result? If you got an error, what did it say? If you got incorrect results, how was it different from what you expected?