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

Count the number of days between two dates in Cognos 8.2 Data Item

Started by cbyrne, 02 Sep 2010 04:46:33 PM

Previous topic - Next topic

cbyrne

Hello does anybody know how to count the numbers of days between two dates in a Data Item and in Report Studio 8.2.  The code below is for 8.4 but i do not have _days_between in the data item.

Data Item
_days_between(sysdate(),[DATEREPORTED])


Thanks

Chris

technomorph


peritas-chris

Use current_date, you should be able to use the _days_between function with that.

_days_between(current_date,[DATEREPORTED])

Sreeni P

Quote from: peritas-chris on 02 Sep 2010 10:27:38 PM
Use current_date, you should be able to use the _days_between function with that.

_days_between(current_date,[DATEREPORTED])

Hi first check what is [DATEREPORTED] column returning? check is that a date or a key? if that is not mapped with a date ? then u need to cast DATEREPORTED to DATE, then apply
the _days_between (sysdate(),[DATEREPORTED])

because sysdate is a DATE attribute with a timestamp

Hopes it fixes Ur problem

cbyrne

Thanks Guys this worked a treat i inserted _current_date into the data item and it worked fine.

Many Thanks

Chris

peritas-chris