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

Dynamic date prompts

Started by Rafiq_123, 06 Feb 2018 02:37:03 AM

Previous topic - Next topic

Rafiq_123

Hi. I need to create 2 date /time prompts where first prompt defaults to 60 before the current date and the next sticks to current date and time. Pls help.

BigChris

I'm sure you can do something more elegant with Javacript, but I'd solve this with a prompt that gives the users a choice between date prompts and the default 60 day range. In your prompt page, you'd have one prompt called ?pDateOption? that has two static options of 'Date Range - select below' and 'Last 60 Days'. Make it a radio button and make it required. Below that have two standard date prompts, called something like ?pBegin? and ?pEnd?

Then in your filter you would have a statement like
?pDateOption? = 'Last 60 days' and [YourDateField] between _add_days(current_date,-60) and current_date
or ?pDateOption? = Date Range - select below' and [YourDateField] between ?pBegin? and ?pEnd?

Rafiq_123

BigChris. Thanks for sharing your thoughts, but that wouldn't work for me. I have incorporated this in a few reports, where user where given options to choose between no. Of days and date range. But this new report had no mention of this dual option in the requirements. Looking for a way that the from _date date/time prompt defaults to current_date-60 on prompt page generation