COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: david.stachon on 29 Apr 2009 06:04:46 PM

Title: Generate Date Range prompt with Macros
Post by: david.stachon on 29 Apr 2009 06:04:46 PM
Hi,

There must be a way to generate a proper date range prompt with macros...

This "works"

[My Date]  between
  #prompt ( 'p start My  Date','date')#
AND 
  #prompt ( 'p end My Date','date')#


...however, this generates two date prompts (i.e. one for each parameter).

Is there a way to leverage "in_range" ...and one parameter that contains the date range (thus generating a nice date range prompt).

..There must be! ....I just can't figure it out.

thanks,
david.
Title: Re: Generate Date Range prompt with Macros
Post by: CognosPaul on 30 Apr 2009 01:21:06 AM
Try:

[My Date] in_range ?P_Date_Range?
Title: Re: Generate Date Range prompt with Macros
Post by: david.stachon on 30 Apr 2009 01:50:36 AM
yes, that generates the prompt; however, I need to do so with a macro so I can set default values.
Title: Re: Generate Date Range prompt with Macros
Post by: CognosPaul on 30 Apr 2009 02:55:43 AM
I don't think there is a way to get prompt macros to work correctly with in range. The best I've managed to do is an extremely ugly:

[date] IN_RANGE { #substitute(',',':',promptmany('date','date','2007-04-01,2007-05-01'))# }

The default doesn't appear in the prompt, but it still works. If you can find a better way, I'd be very interested in seeing it.