COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: JoelR on 03 Apr 2008 01:06:52 PM

Title: Distinguishing changes that happen monthly
Post by: JoelR on 03 Apr 2008 01:06:52 PM
If I have a column that shows by date (i.e. yyyymmdd) the last time the instructions for performing a task had been modified then how do I distinguish those tasks that happened just last month?

For example, now I want to know task changes for the month of March.  Next month I want to know task changes for the month of April
Title: Re: Distinguishing changes that happen monthly
Post by: almeids on 03 Apr 2008 03:14:48 PM
extract(month,[your date])=extract(month,current_date)-1    ???
Title: Re: Distinguishing changes that happen monthly
Post by: blom0344 on 04 Apr 2008 07:15:46 AM
Quote from: almeids on 03 Apr 2008 03:14:48 PM
extract(month,[your date])=extract(month,current_date)-1    ???



CASE WHEN
extract(month,current_date) = 1
THEN extract(month,[your date]) = 12 AND extract(year,[your date])=extract(year,[current_date])-1
ELSE extract(month,[your date]) = extract(month,current_date)-1 AND extract(year,[your date])=extract(year,[current_date]) END

   :D
Title: Re: Distinguishing changes that happen monthly
Post by: almeids on 07 Apr 2008 08:20:22 AM
Thanks for paying attention Ties, bad oversight on my part.