Hi All,
I have a report where i have an optional date prompt. I want the report studio to use sysdate if the user doesn't select a date. I tried several ways and nothing worked. Can you guys help me ?
Thanks,
MS
Quote from: MS on 20 Aug 2016 08:52:29 PM
Hi All,
I have a report where i have an optional date prompt. I want the report studio to use sysdate if the user doesn't select a date. I tried several ways and nothing worked. Can you guys help me ?
Thanks,
MS
Hi,
How about using a prompt macro with $current_timestamp as the default value argument for this:
[Your date item] = #prompt('Your parameter', 'date', $current_timestamp)#
MF.
Thanks MFGF. It was throwing error for some reason. but this worked.
to_date (#sq(prompt('Selected Date', 'date', '2007-09-09'))# , 'YYYY-MM-DD' )
Actually, this worked without hard coded date
to_date (#sq(prompt('Selected Date', 'date', timestampMask ( _add_days ( $current_timestamp , -1 ) , 'yyyy-mm-dd' )
))# , 'YYYY-MM-DD')
Thanks again MFGF.
How did you make the date prompt default to blank? ...or how did you make the date prompt default to your calculated date?
Hi Dougp, I don't understand your question.
Quote from: dougp on 25 Aug 2016 11:34:38 AM
How did you make the date prompt default to blank? ...or how did you make the date prompt default to your calculated date?
They're using a prompt macro (#prompt()#), and one of the parameters is defaultValue. You can specify a literal or function for this parameter. If no value is selected in the prompt, it will use defaultValue.