Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

last month

Status
Not open for further replies.

HrvojeVd

Programmer
Jun 22, 2008
36
HR
I would like to get the day of previous month?

I tried currentdate - 1 but it doens't work.
 
Probably gives you the prior day. What Cognos product are you using? Impromptu should offer you add-months as a function; add-months(<datefield>,-1) will give you the same day in the prior month.
Or have I misunderstood what you're attempting to retrieve?

soi là, soi carré
 
Cognos 8 offers the _add_months function as well, so it would be:

extract(month,(add_months(current_date,-1))

Ties Blom

 
extract(month,(_add_months(current_date,-1)))

Just tested it. works as designed..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top