COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: Manu0521 on 27 May 2015 08:51:56 AM

Title: Subtract 2 datetime fields
Post by: Manu0521 on 27 May 2015 08:51:56 AM
Hi All,

Date Time1  -Sep 16, 2014 2:53:43.797 PM

Date Time 2 - Sep 16, 2014 3:54:00.253 PM

I have two columns DateTime 1 and Date Time 2 . I wanted to have a third calculated column which would subtract DateTime2 from DateTime 1.

I want the result in hh:mm:SS format.

Should I use a sql server function or a cognos function.

I am right clicking my query subject and creating a new query item , and what should be my expression to achieve the difference in minutes.

Thanks,
Manu

Title: Re: Subtract 2 datetime fields
Post by: Raghuvir on 29 May 2015 08:05:15 AM
Quote from: Manu0521 on 27 May 2015 08:51:56 AM
Hi All,

Date Time1  -Sep 16, 2014 2:53:43.797 PM

Date Time 2 - Sep 16, 2014 3:54:00.253 PM

I have two columns DateTime 1 and Date Time 2 . I wanted to have a third calculated column which would subtract DateTime2 from DateTime 1.

I want the result in hh:mm:SS format.

Should I use a sql server function or a cognos function.

I am right clicking my query subject and creating a new query item , and what should be my expression to achieve the difference in minutes.

Thanks,
Manu



hi,

is the value is date field 1 and 2 going to be the same always ? like the example which you have provided date in both the fields is Sep 16, 2014.

Regards