on 09-19-2017 8:59 AM
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
Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.