COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: TSCognos1 on 18 Feb 2016 10:24:23 AM

Title: casting a datetime to a date from Sql database in report studio takes off 2 days
Post by: TSCognos1 on 18 Feb 2016 10:24:23 AM
Hi when casting a datetime field from a SQL database to a date in cognos 1022 the result is always 2 days behind. Does anyone know why?

if you don't cast the item then it comes through fine
Title: Re: casting a datetime to a date from Sql database in report studio takes off 2 days
Post by: MFGF on 18 Feb 2016 10:36:18 AM
Quote from: TSCognos1 on 18 Feb 2016 10:24:23 AM
Hi when casting a datetime field from a SQL database to a date in cognos 1022 the result is always 2 days behind. Does anyone know why?

if you don't cast the item then it comes through fine

I don't see that in my 10.2.2 instance over SQL Server 2012. What expression are you using? How are you connecting from Cognos to the database?

MF.
Title: Re: casting a datetime to a date from Sql database in report studio takes off 2 days
Post by: BigChris on 19 Feb 2016 01:56:55 AM
I don't see it over SQL 2008 using 10.2.0 either. Are you just using cast([DateTime Field],date)or something different?