Skip to Content
avatar image
Former Member

Need help with dynamic multi value @prompt and case (IDT 4.x)

Hello, 1st timer here and need some help please.

Im trying to create a dynamic prompt that will automatically select a list of values from a LOV depending on the month of the current date. For example if the month number = 9 then the prompt will preselect the values 1,2. If the month number is 10 then the prompt will pre-select the values 1,2,3
My LOV (VPERIODS) will already list the correct number of values based on the month number.
This is my code

DimDate.PERIOD IN case when @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,Persistent,{'99'}) = '99' then  [RETURN A LIST A VALUES] ELSE @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,Persistent,{'99'}) END 

The error I get is incorrect syntax near keyword 'case'

If I change the prompt to MONO and use '=' instead of IN then it works fine but I can only set 1 value - but I need to prompt to pre-select a list of values.
Is this possible, can somebody please explain how this can be achieved if possible.
Another method I tried was this:

DimDate.PERIOD = CASE WHEN {fn month(convert (SMALLDATETIME, {fn CURDATE()}))} = 9 then @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,{'1','2','3'}) WHEN {fn month(convert (SMALLDATETIME, {fn CURDATE()}))} = 10 then @Prompt('Enter Period','N','VPERIODS',Multi,Constrained,{'1','2','3','4'}) END 

but this also does not work

many thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 19, 2017 at 03:19 PM

    Any suggestions?

    Add comment
    10|10000 characters needed characters exceeded