I have specified the structure of table, current query, current output and required output in the attachment file for more easier to understand the complexity of query. Hope this information would suffice to fulfil my requirement. Please let me know if you need any more information. Thanks Jayesh desc calls Name Null? Type ----------------------------------------- -------- ---------------------------- ENTRYID NOT NULL VARCHAR2(255) CALL_DATE NOT NULL TIMESTAMP(6) CLI NOT NULL VARCHAR2(255) ENTRYTYPE VARCHAR2(255) WINSTATUS VARCHAR2(255) WINACTION VARCHAR2(255) COMPETITION VARCHAR2(255) PRESENTER VARCHAR2(255) PRODUCER VARCHAR2(255) COST VARCHAR2(255) SERVICE VARCHAR2(255) ANSWER VARCHAR2(255) IVRLINE VARCHAR2(255) IVRPROMPTS VARCHAR2(255) IVRSTATUS VARCHAR2(255) Current Query: SELECT CLI, CASE WHEN (count(d27) > 0) THEN 1 ELSE 0 END as day1, TO_NUMBER(CASE WHEN (count(d28) > 0) THEN 1 ELSE 0 END) as day2, TO_NUMBER(CASE WHEN (count(d29) > 0) THEN 1 ELSE 0 END) as day3, TO_NUMBER(CASE WHEN (count(d30) > 0) THEN 1 ELSE 0 END) as day4 FROM ( SELECT c.CLI, DECODE( TRUNC(c.CALL_DATE), TO_DATE($P{day1}, 'YYYY-MM-DD'), 1) d27, DECODE( TRUNC(c.CALL_DATE), TO_DATE($P{day2}, 'YYYY-MM-DD'), 1) d28, DECODE( TRUNC(c.CALL_DATE), TO_DATE($P{day3}, 'YYYY-MM-DD'), 1) d29, DECODE( TRUNC(c.CALL_DATE), TO_DATE($P{day4}, 'YYYY-MM-DD'), 1) d30 FROM calls c WHERE c.CALL_DATE BETWEEN TO_DATE($P{day1}, 'YYYY-MM-DD') AND TO_DATE($P{day4} || ' 23:59:59', 'YYYY-MM-DD HH24:MI:SS') $P!{filterBy} ) GROUP BY CLI ORDER BY CLI Current Output: CLI Day1 Day2 Day3 Day4 Total 441132394629 0 1 0 0 1 441132533793 0 0 0 1 1 441142373223 0 0 0 1 1 441162611449 0 0 1 0 1 441207566886 0 1 0 0 1 441227763301 0 1 0 1 2 441233637736 0 0 0 1 1 441252874882 0 0 1 0 1 441273861500 0 0 1 0 1 441274504470 0 0 1 0 1 441282699900 0 0 0 1 1 441291421019 0 0 1 0 1 441295272411 0 0 1 0 1 441296582599 0 0 1 0 1 441305812817 0 0 1 0 1 441315380271 0 0 0 1 1 441315562413 0 0 1 0 1 Required Output: CLI Day1 Day2 Day3 Day4 Day5 Day6 Total 441132394629 0 1 0 0 0 1 1 441132533793 0 0 0 1 1 0 1 441142373223 0 0 0 1 0 1 1 441162611449 0 0 1 0 0 1 1 441207566886 0 1 0 0 1 441227763301 0 1 0 1 2 441233637736 0 0 0 1 1 441252874882 0 0 1 0 1 441273861500 0 0 1 0 1 441274504470 0 0 1 0 1 441282699900 0 0 0 1 1 441291421019 0 0 1 0 1 441295272411 0 0 1 0 1 441296582599 0 0 1 0 1 441305812817 0 0 1 0 1 441315380271 0 0 0 1 1 441315562413 0 0 1 0 1 I have not filled up other 1's and 0's for remaining rows. But It should apply the condition and should display exacly as 1 or 0. Currently, it is hard-coded in the query and prompts every time the date for day1, day2, day3, day4 and output would display as above cited. Instead of asking each time value of date like day1, day2,day3.day4 , It should only prompt start date and end date for the desired report. The data for each above column should be dispalyed on the basis of specified date. i.e. six/two/four columns I would like to know the modifed script about the same where I can achive the desigred output.