COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: Desperado on 10 Apr 2006 05:20:04 AM

Title: help required in solving a query
Post by: Desperado on 10 Apr 2006 05:20:04 AM
can anyone provide me with the query for last full month(ie, based on the current date .. last full month is 1-Mar-2006 to 31- Mar -2006) and year to date (1- Jan -2006 to current date) ???
Title: Re: help required in solving a query
Post by: Desperado on 10 Apr 2006 06:07:01 AM
Ok Guys,
Got it done.. thanks for your patience  ;D
Title: Re: help required in solving a query
Post by: mrcool on 10 Apr 2006 06:26:10 AM
Hi...please post the query...
Title: Re: help required in solving a query
Post by: Desperado on 10 Apr 2006 06:29:51 AM
We have some javascript also included in the query. But i can give you the query implemented for LFM and YTD

LFM:
(?All Dates?='1' and (month([01803V01].[Terminations].[Exit Date])=month(_add_months(current_date,-1))) and
(year([01803V01].[Terminations].[Exit Date])= year(_add_months(current_date,-1))))
OR
YTD:
(?All Dates?='2' and (year([01803V01].[Terminations].[Exit Date])= year(current_date)) and ([01803V01].[Terminations].[Exit Date]<= current_date)  )
OR
OTHER:
(?All Dates?='0' and
([01803V01].[Terminations].[Exit Date] >= ?Par_Dte_FromDt? and [01803V01].[Terminations].[Exit Date] <= ?Par_Dte_ToDt?))
Title: Re: help required in solving a query
Post by: mrcool on 10 Apr 2006 07:02:05 AM
Thank u :)
Title: Re: help required in solving a query
Post by: bmccusker on 11 Apr 2006 10:32:13 AM
I am interested in what query you used to get last month.


Thanks in advance