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!

Subtracting Dates

Status
Not open for further replies.

UcfMike

IS-IT--Management
Mar 29, 2007
184
US
How can I subtract today's date from a date field in my report?
 
[date item in report] - current_date

or

_days_between(current_date, [date item in report])

others as well..
 
Or, make sure you define these calculations within the framework.
Not exactly an answer you were waiting for, but I just spend a lot of time figuring out how this works.
Defining 'straight' subtractions will have Cognos forcing you to activate local processing.
What it then returns is a Cognos datatype 'time value' that you can format.
For strictly whole days as outcome of the calc we reverted to first formatting the date to the julian day type and then subtraction (in our case Oracle). That does work with only database processing activated, but is not generic.

Ties Blom

 
I ended up using days between to get the report to work, thanks.

For now, I've been blessed with the task of just getting the reports done. Having the calculations done in Framework Manager makes sense, but that will come in the optimization phase.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top