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

 

prompt end date should be my schedule run date always dynamically

Started by krishdw85, 10 Sep 2024 12:23:26 PM

Previous topic - Next topic

krishdw85

Hi Team,

i have a start date & end date in my report and whereas start date is static and end date should be always current date as per scheduled which is tuesday in my report.
I somehow unable to recall how to set  default slections in cognos 10.2  Can someone advice how to set end date as current date for default prompt in scheudle.

Regards,
Krish

dougp

It's scheduled.  Don't use a prompt.  Use current_date

cognostechie

Quote from: krishdw85 on 10 Sep 2024 12:23:26 PMHi Team,

i have a start date & end date in my report and whereas start date is static and end date should be always current date as per scheduled which is tuesday in my report.
I somehow unable to recall how to set  default slections in cognos 10.2  Can someone advice how to set end date as current date for default prompt in scheudle.

Regards,
Krish


There is a property of the Date prompt where you can put a default selection. Put 1901/01/01 there. In the query, put a filter like:

( ?EndDate? = 1901-01-01 and [Date] = current_date)
                     OR
( ?EndDate? <> 1901-01-01 and [Date] = ?EndDate? )

 

dougp

Except that the date must be required.  If the date filter is optional, the date prompt is optional and using the "edit box" UI, and no value is entered, the result is all rows.

This should work:
[Date]= #prompt('End Date', 'date', 'current_date')#

cognostechie

No. If there is a default date specified and no date is entered then the default value will be considered and in that case the filter will work and the result will be data only till the current day.

dougp

Got it.  I missed a step.  You don't leave it blank, you leave it at the default.  So you'd schedule it with an end date of 1901-01-01.

krishdw85

Sorry... somehow it is not working.... Can someone please guide me exact which logic to be used.