COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: hrk551 on 05 Apr 2010 09:17:03 AM

Title: conversion from hours to days?
Post by: hrk551 on 05 Apr 2010 09:17:03 AM
hello all,
Can some one help me in converting hours to days.

ex: [leaves] gives number of hours available and for suppose for epmloyee 123 there are 35 hours of leave then how should i display this [leaves] in as 4 days and 3 hrs.

Thanks
Title: Re: conversion from hours to days?
Post by: the_xxx on 05 Apr 2010 01:17:04 PM
cast(cast(<dataitem>/1440, INTEGER), VARCHAR(10)) +
':' + cast(cast(mod(<dataitem>,1440)/60, INTEGER), VARCHAR(10)) +
':' + cast(mod(<dataitem>, 60), CHAR(2))
Title: Re: conversion from hours to days?
Post by: blom0344 on 06 Apr 2010 06:01:43 AM
cast(floor ([dataitem]/8),varchar(10))||' days '||cast(mod([dataitem],8),varchar(2))||' hours'