Tuesday, December 2, 2008

Dates and Report Parameters

When configuring a Date Parameter in BI Publisher the Date Format String has to conform to the Java SimpleDateFormat format mask. Some commonly used examples are:


Format MaskOutput
dd-MMM-yyyy01-Jan-2008
dd/MM/yyyy HH:mm:ss01/01/2008 13:25:00
hh:mm a01:25 PM
h:mm a1:25 PM
EEE dd-MM-yyTue 01-01-08
EEEE dd-MM-yyTuesday 01-01-08

Default values for Dates
This can either be:
• A fixed date and must match the format mask specified in Date Format String
• One of the following functions:


Function NameDescription
SYSDATE()Today’s Date
FIRST_DAY_OF_MONTH()First day of the current Month
LAST_DAY_OF_MONTH()Last day of the current Month
FIRST_DAY_OF_YEAR()First day of the current Year
LAST_DAY_OF_YEAR()Last day of the current Year

When using the functions above the they need to be surrounded by a curly brace followed by a dollar sign i.e. {$FIRST_DAY_OF_MONTH()$}
Simple addition and subtraction is also supported with these functions, for example:
{$SYSDATE()+1$} would specify tomorrows date as the default parameter.

No comments: