COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: Desperado on 07 Jun 2006 03:05:27 AM

Title: [Solved]date difference calculation
Post by: Desperado on 07 Jun 2006 03:05:27 AM
Hi All,

I would like to find the date diff between two date fields. and I have to show this difference in the form of days, hours and minutes.

Like , the diff should be shown like 2 days, 12 hours, 25 minutes.. Id there any predefined function in cognos 8 to do this ... I have tried with almost all the functions. But i might be missing some where ... Any help is appreciated. Thanks in Advance
Title: Re: date difference calculation
Post by: bdybldr on 08 Jun 2006 07:28:12 AM
Desperado,
I don't have time to work on this right now but it seems that if you set the Date/Time format for both dates to the same (ie. Short Month, Day = 2 digits, Year = Show Century, Hours = 2 digits, minutes = 2 digits, seconds =  2 digits), then you can cast them as chars as use a substring to parse them out.  Cast them as numbers and perform your calculations on each of them seperately.

I'll work on this when I get the chance.  Good luck.
Title: Re: date difference calculation
Post by: bdybldr on 28 Jun 2006 09:28:34 AM
Desperado,  what's the status of this issue?  Have you found a solution?  Please keep us posted.