COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: dfreed on 16 Mar 2015 02:19:51 PM

Title: issue with subtracting from timestamp with timezone in 10.2.2
Post by: dfreed on 16 Mar 2015 02:19:51 PM
Hi all,

A colleague of mine encountered an issue when attempting to subtract from a timestamp with timezone value. When attempting to subtract 6 hours using the _add_hours function, he actually received a value almost 11 days into the future. When I started looking into it, I also tried _add_minutes and _add_seconds. Both functions also gave incorrect (but different) results.

If I remove the time zone portion of the timestamp (e.g. 2015-03-12 23:15:02.224000000 instead of 2015-03-12 23:15:02.224000000-05:00), _add_hours calculates properly. All 3 calculate properly if positive integer values are used for the second argument (i.e. adding time instead of subtracting).

We are running a single server installation (Windows Server 2008 x64) of 10.2.2, and the server time zone is set at GMT-05:00.

I've attached a report spec (model not important). If anyone can offer insight into why I may be seeing this, I would appreciate it.

-D