If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Getting previous month date

Started by cognos4all, 07 Dec 2011 04:07:42 PM

Previous topic - Next topic

cognos4all

Hello,
I am trying to get the previous month date in Text item. I am setting the source type as report expression and on Report expression property i tried to calculate the date and doesn't seem to work. I tried _add_months function and getting syntax error. For example i tried these and didn't worked.
_add_months (_first_of_month (Today ()),-1)

_first_of_month(_add_months(current_date, -1))

When i run the report, i want to display previous month for example Nov 2011

I even tried to calculate the previous month in a query, but since the query is not associated with the text item, it won't allow me to attach the calculated data item to the text item.

Any help woud be very much appreciated.

Thanks

cognostechie

Instaed of using a text Item, try using a Singleton, point that to the Query that has the calculation for last Month and then use that data item for last Item in that singleton.

cognos4all

Thank you very much; it work's if we use singleton object.

Thanks again