COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: jshamm on 25 Nov 2014 08:01:36 AM

Title: Pass Prompt Value to Native SQL variable
Post by: jshamm on 25 Nov 2014 08:01:36 AM
Is there any way to pass a date prompt to a native SQL variable?  As a test I have this simple code:

DECLARE @DatePrompt as datetime

set @DatePrompt = #sq(prompt('paramDate', 'datetime'))#

SELECT @DatePrompt

This does not work when I put it in a report studio query, though.  I get "The server returned an unrecognizable query framework response".  Is it possible to pass a prompt value to a SQL variable?
Title: Re: Pass Prompt Value to Native SQL variable
Post by: kc9400 on 25 Nov 2014 08:22:40 AM
SELECT name, date, example
FROM database.database
WHERE date = (#prompt('prompt name')#)

For IN would be WHERE date IN (#promptmany('prompt name')#)

I think this is what you're after?