BIP 11.1.1.7.1: Using parameter in select list
I have a report which has a sql which aggregates data to prior_day, month-to-date, year-to-date based on the parameter passed. In this case the parameter was defined as a varchar2/text would have a value like 01/14/2014
The SQL is as follows, you can see that the :p_parm_date is used in the select-list to appropriately sum the data.
SELECT
.......
, ROUND( SUM(
CASE
WHEN TO_CHAR(t.TMSHT_DATE,'mm/dd/yyyy') = TO_CHAR(to_date(:p_parm_date, 'mm/dd/yyyy')-1,'mm/dd/yyyy')
THEN HOURS
ELSE 0
END ) ) PRIOR_DAY_HOURS
, ROUND(SUM(
CASE
WHEN TO_CHAR(t.TMSHT_DATE,'mm') = TO_CHAR(to_date(:p_parm_date,