08-13-2012 10:42 PM
I really spent a lot of time on this and couldnt figure out a solution. Actually the problem sounds quite simple. My input field PERIOD has been detected has Datetime20. by SAS.
Now I create a Prompt (PROMPTNAME) with Prompt Type: Date; Date Type: Month. Afterwards I insert a filter in the query builder: PERIOD IN A RANGE PROMPTNAME. However my resultset is always empty.
I hope sbd. can help me with this.
08-14-2012 12:04 AM
I'm not at all familiar with the method, but would it work if you declare the prompt type as a timestamp? take a look at: http://support.sas.com/documentation/cdl/en/wbsvcdg/62759/HTML/default/viewer.htm#n0engedu4ofcwvn1o4...
08-14-2012 04:46 AM
thanks for your answer unfortunately this is not an option as the user wants to enter a month in a certain year.
Any further ideas why it is not working?
08-14-2012 07:38 AM
One way around this would be to not use the Query Builder but to write your own SQL in a Program node.
This would allow you to define the prompt as you did...
...and then to assign the prompt to your Program node (under "Properties").
You then can deal with this datetime/date "missmatch" in your code.
08-15-2012 02:41 AM
What I don't know and you would have to try is how to assign a prompt in a Query Builder when using this prompt in an advanced expression. But if this is possible then yes: You can use any SAS function in the advanced expression builder.
O.K - found it!
With the query builder you define an advanced filter like:
intck('month',datepart(t1.period),"&myprompt"d) = 0
Then you define a prompt (here "myprompt")- and done!
05-06-2014 08:28 AM
I've stumbled over the same question as Hagen while testing date prompts in SAS EG 5.1.
While Patrick's solution certainly works fine, I feel like the prompting framework should work especially for less experienced users, who are rather not familiar with macro variables and functions like "datepart".
Is there any way to use the prompting with Date type month (or week, year, quarter...) without complicated workarounds, but rather "as it looks like".
Especially, which operator are these date typ thought to be used with? I tried EQ and BETWEEN but neither of them got me the logical results (namely all records where the input field is between the first and the last day of the specified month / week / year).
With EQ i just got the records of the first day only, BETWEEN gave no results at all.
Thanks in advance,