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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cognos Date Problem 1

Status
Not open for further replies.

Swathi37

Vendor
Dec 23, 2002
77
US
Hi All,
I have a problem automating the report process. How do I automate the Cognos report with the following running schedules.
I have an imr report which should give me the report from say Aug 1st to Aug 15th when I run this report on 16th Aug. When the same report runs on Sep 1st it should bring the data from 16th Aug to 31st Aug.
So this reports should run bi-monthly. Is it possible to automate the dates for ex using Firstdayofmonth function or LastDayofmonth function. Please advice.
Thank you
Swathi
 
How about something like the following:
ReportDate BETWEEN (If (Day(Date()) < 16) then (AddDays(AddMonths(FirstOfMonth(Date()),-1),15)) Else (AddMonths(FirstOfMonth(Date()),-1)) AND (If (Day(Date()) < 16) then (AddDays(FirstOfMonth(Date()),-1)) Else (AddDays(FirstOfMonth(Date()),14))

Explanation:
If the day number of the current month is less than 16, then return the 16th of the previous month, else return the 1st of this month.
If the day number of the current month is less than 16, then return the 15th of the this month, else return the 31st of last month.


Pain is stress leaving the body.

DoubleD [bigcheeks]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top