Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Last Date in Date Prompt

Status
Not open for further replies.

Kaiaualad

Technical User
Jun 15, 2001
70
AU
I have looked everywhere but cannot find a method to use {CurrentDay -1}for example as the "Last Date" property on a Report Studio Date Prompt.It requires a hard coded date in date format. any pointers on this?

Thanks
 
The only way to do this is to use Javascript on your prompt page.

If you have access to the Cognos KnowledgeBase you should search there for some samples. Be aware of that the Javascript prompting toolkit has changed between 8.2 and 8.3 so any sample scripts for 8.2 won't work in 8.3/8.4 and the other way round.

You might want to take a look at those KB articles:

KB 1019263 - Javascript: How to change the default value in date & time prompts
KB 1039556 - Dynamic default date for a date prompt
KB 1041912 - Javascript: Get the default value for a prompt from a database table.

Happy new year!
 
Thanks -
I am actually not looking to set the default value or default date, but rather limiting the 'Last Day' option so the calendar itself only goes until say the end of the year, no further.
This is different from the default day which is the shadow on the prompt itself
 
Ok sorry, I misunderstood your question.

Unfortunately I don't see a solution to limit the last date using the default date prompt.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top