COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: inu on 20 Aug 2015 01:26:54 PM

Title: Unable to display day and hours after subtracting two date items
Post by: inu on 20 Aug 2015 01:26:54 PM
Hi Team,

I have one report developed in cognos7, and migrated into Cognos 10. in which one column is displaying difference between two date items say
{sysdate}-[Booking].[Cec_Current_Tracking].[STATUS_DATE]
under data format property, time interval is set in such a way that 'display days set as yes' , 'display hours set as yes' , minutes and milisecond set as no.
In Cognos7 data is displaying properly "days and hours" , but in cognos 10 "0 days 0 hours" is displaying .

Can you please suggest me , where is mistake, and what should i do to fix this issue.

I really appreciate to your valuable response.



Regards
Inam

Title: Re: Unable to display day and hours after subtracting two date items
Post by: ceosp on 20 Aug 2015 02:38:04 PM
Data Format the column as Date/Time and define a Pattern if necessary (yyyy/MM/dd hh:mm:ss)
Title: Re: Unable to display day and hours after subtracting two date items
Post by: inu on 20 Aug 2015 11:13:12 PM
Quote from: ceosp on 20 Aug 2015 02:38:04 PM
Data Format the column as Date/Time and define a Pattern if necessary (yyyy/MM/dd hh:mm:ss)

Hi ceosp,

I tried that pattern , but it didnot work. I dont understand, why we need pattern for this issue, it is based on the calculation.
Calculation itself is not happening. I made aggregate function to none as well, still not working.

Can you please give me some idea to resolve this issue.

Thanks in advance
Title: Re: Unable to display day and hours after subtracting two date items
Post by: MFGF on 21 Aug 2015 03:37:20 AM
Why are you using {sysdate} in your expression? What happens if you use current_date?

We have mentioned previously in posts to you that Cognos 7 and Cognos 10 are entirely different products. Just because an expression works in Cognos 7 doesn't mean it will automatically work in Cognos 10. You need to think about expressions like this and change relevant syntax pieces to the Cognos 10 equivalent - just blindly expecting it to work the same way is not a strategy for success.

Cheers!

MF.
Title: Re: Unable to display day and hours after subtracting two date items
Post by: inu on 21 Aug 2015 09:07:12 PM
Quote from: MFGF on 21 Aug 2015 03:37:20 AM
Why are you using {sysdate} in your expression? What happens if you use current_date?

We have mentioned previously in posts to you that Cognos 7 and Cognos 10 are entirely different products. Just because an expression works in Cognos 7 doesn't mean it will automatically work in Cognos 10. You need to think about expressions like this and change relevant syntax pieces to the Cognos 10 equivalent - just blindly expecting it to work the same way is not a strategy for success.

Cheers!

MF.


Thanks MFGF,