COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: kyle556 on 15 Aug 2008 06:17:19 PM

Title: Can't show intervals (hour to second) in short form
Post by: kyle556 on 15 Aug 2008 06:17:19 PM
I'm working with hour to second intervals and whenever I add them to a report studio report, they show up in long form. Example: "1 hour 13 minutes 42 seconds". I would like to show them in short form like this: "1:13:42". I assumed that it was a data format option, but I couldn't find such an option in format properties. I started a service request with Cognos, but I was told what I want is not possible in the current version. In long form, intervals take up too much space on a report. I'm hoping that someone might know a trick to get around this limitation. Can anyone help? I'm running 8.3 SP2.
Thanks.
Title: Re: Can't show intervals (hour to second) in short form
Post by: blom0344 on 18 Aug 2008 02:49:44 AM
Depending on the original format of the data you can use seperate calculation objects that hold the values for hour/minute/second. This involves among others the 'mod' function and division by 3600 / 60.
The end result is then achieved by concatenating the values as:

[hourpart]&':'&[minutepart]&':'&[seconds]

after creating strings from the numerical values (by using cast)