COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Roger Self on 24 Jan 2014 10:10:27 AM

Title: Cognos BI 10.2 optional macro date prompt
Post by: Roger Self on 24 Jan 2014 10:10:27 AM
My Cognos 10.2 report based on a SQL macro includes 17 optional prompts.  The types are string, integer, and date.  With the exception of the date prompts, all work properly.  Numerous optional date prompt tries such as the below have not worked.

#(prompt('Beginning Date','date "1900-01-01"','1900-01-01',' and a.date >= ')#
#(prompt('Beginning Date','date','1900-01-01',' and a.date >= ')#
and a.date >= #prompt('Beginning Date','date','Current_Date')#

Per the IBM site, for date prompts, the type should be like the first.
The second reads like my working string and integer prompts.
The third will not work, partly because as an optional prompt, "and a.date >= " is outside of the prompt rather than the 4th argument.

I urgently need to resolve this issue.  Please respond with suggestions as soon as possible.

Thank you.
Title: Re: Cognos BI 10.2 optional macro date prompt
Post by: adik on 26 Jan 2014 08:55:56 AM
the third prompt you defined it as date but for a default value you placed a string. If Current_Date is actually a data item then you should enclose it in [] like #prompt('Beginning Date','date','[Current_Date]')#