Hi,
The code below is working for all records but its not working for "Last month" and "Current month" values. If I select "Last month" when running the report query, its not showing last month records instead showing all the records. Can you please advise?
to_char(fffdate, 'yyyymmdd') >= decode(@Prompt('Select time for which to run the report(or * for all):', 'A', {'Current Month', 'Last Month','*'}, MONO, CONSTRAINED,persistent,{'*'},User:0)
, '*', '*'
, 'Current Month', to_char((select sysdate from sys.dual), 'YYYYMM') || '01'
, 'Last Month', to_char(add_months((select sysdate from sys.dual), -1), 'YYYYMM') || '01'
)
AND
to_char(fffdate, 'yyyymmdd') < decode(@Prompt('Select time for which to run the report(or * for all):', 'A', {'ALL','Current Month', 'Last Month','*'}, MONO, CONSTRAINED,persistent,{'*'})
, '*', '*'
, 'Current Month', to_char(add_months((select sysdate from sys.dual), 1), 'YYYYMM') || 01
, 'Last Month', to_char((select sysdate from sys.dual), 'YYYYMM') || '01'
) OR '*' = '*'
Thanks.
Just to add further I am trying modify the filter to have "*" in the list so that the user can select it and retrieve all the records. The code is working fine if I remove '*' (all the letters blue in color). but when I put the value "*" its retrieving all the records but failing to get for "current month" and "last month" records. In other words, I am trying to make it optional.
Please advise. Thanks.