Friday, January 18, 2013

BI Publisher report is showing incorrect date(Showing 1 day less than actual date in database)

Problem
BI Publisher report is showing incorrect date. It is showing date one day less than actual date in database and answers.

Solution
i.  Description
Lets take the above example of BI Publisher report. Here I have selected the date 09-Sep-2011 in parameter range. But when i generate the report, it is showing date
1 day less (i.e., 08-Sep-2011). 

The problem is with date column used in query, automatically the date column changes to canonical format(i.e., 2009-06-03T18:44:32.000-07:00). This canonical format comprises of Date, Timestamp and UTC.. So you need to suppress timestamp and UTC from date to resolve this issue.

ii. Procedure
1. Open the dataset linked to the BIP report.
2. Edit the query
3. Let say the date column is Settlement_Date. You need to use CAST function to convert this date to char to suppress timestamp and UTC.

Example
Column Name - Settlement_Date

should be change to

CAST(settlement_Date AS CHAR)