If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to make sysdate as default for optional date prompt

Started by sakthivelmani, 20 Aug 2016 08:52:29 PM

Previous topic - Next topic

sakthivelmani

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

MFGF

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.
Meep!

sakthivelmani

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' )

sakthivelmani

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.

dougp

How did you make the date prompt default to blank?  ...or how did you make the date prompt default to your calculated date?

sakthivelmani


AnalyticsWithJay

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.