Optional Prompt in PS Query
Sometimes we need to create a PS Query with optional prompt i.e. if there are 3 prompt in PS Query then if user enter a value, the query fetches relevant rows otherwise it fetches all the rows.
For example we created a PS Query which have 3 prompt as shown in below screen
Now if we only pass birthdate then we will get this result
Now there is way to bypass this error and fetch the data on the basis of birthdate. To achieve this we need to add expression in our PS Query. If criteria is character type then we have to add expression ' ' like this
*Please make sure, there should be space between single quotes (' ').
If criteria is number type then we have to add expression with 0 like this
After adding expression, final step is we need to group criteria and expression like this
Make sure, while grouping the criteria the logical action should be OR not AND. Now, check whether we get data after passing the same birthdate or not
We get the data only after passing birthdate. In short for optional prompt first we need to set expression and then grouping of that criteria.
No comments:
Post a Comment