Determine the difference between two datetime values in Cognos RRDI Reporting
We have two timestamp attributes in an RTC work item. Using the Cognos RRDI Report Studio, how can we determine the difference between the datetime values fetched from these fields? The resulting answer should be in hours.
Example:
Attribute 1: 18 Aug 2014, 01:00:00 PM
Attribute 2: 19 Aug 2014, 02:00:00 PM
Result: 25 hours
Please let us know how to achieve this.
Example:
Attribute 1: 18 Aug 2014, 01:00:00 PM
Attribute 2: 19 Aug 2014, 02:00:00 PM
Result: 25 hours
Please let us know how to achieve this.
One answer
Hello Sanket,
a solution to your request is described at this link:
http://www.cognoise.com/community/index.php/topic,7912.msg25908.html#msg25908
that is in minutes, to get it in hours it could be modified to something like this
Best Regards,
Francesco Chiossi
a solution to your request is described at this link:
http://www.cognoise.com/community/index.php/topic,7912.msg25908.html#msg25908
(extract(hour,[Data Item2])*60+extract(minute,[Data Item2]))-(extract(hour,[Data Item1])*60+extract(minute,[Data Item1]))+_days_between([Data Item1],[Data Item2])*1440
that is in minutes, to get it in hours it could be modified to something like this
extract(hour,[Data Item2])-extract(hour,[Data Item1])+_days_between([Data Item2],[Data Item1])*24
Best Regards,
Francesco Chiossi