COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: adoremars on 08 Oct 2009 04:36:31 AM

Title: Difference between 2 time stamps in mintues
Post by: adoremars on 08 Oct 2009 04:36:31 AM
Hi.

I have two time stamp fields like Oct 5, 2009 2:50:06 PM and Oct 5, 2009 4:58:06 PM. Need to find the difference between these two fields and the output should be in minutes (number). Also i use a prompt having the selection criteria's like <20, between 20 and 60 etc in the prompt page, so the difference should be a number.

Any help to achieve this is appreciated :)

thanks
Title: Re: Difference between 2 time stamps in mintues
Post by: billylodz on 08 Oct 2009 04:54:43 AM
(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
Title: Re: Difference between 2 time stamps in mintues
Post by: adoremars on 08 Oct 2009 05:58:26 AM

Thanks a lot Billy...