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

Converting a Date Calculation to a number/string

Started by krevix, 03 Aug 2023 06:02:39 AM

Previous topic - Next topic

krevix

Hi all

I have 2 dates that I am subtracting from one another to get a date difference: My expression is: current_date -[DUE_DATE] this gives me the correct result but its an interval like "5 Days"

I want to remove the Days and just get the number eg: "5 Days" --> "5"

I tried the day function but it's not supported, also tried cast to integer and im not getting good results.

Any idea?

MFGF

Quote from: krevix on 03 Aug 2023 06:02:39 AM
Hi all

I have 2 dates that I am subtracting from one another to get a date difference: My expression is: current_date -[DUE_DATE] this gives me the correct result but its an interval like "5 Days"

I want to remove the Days and just get the number eg: "5 Days" --> "5"

I tried the day function but it's not supported, also tried cast to integer and im not getting good results.

Any idea?

Hi,

There is a Cognos function _days_between() that returns the difference in days between two dates.

_days_between(current_date, [DUE_DATE])

Cheers!

MF.
Meep!