I had asked a question earlier and here is the link
since then the requirements have changed
The user wants the capability to select All Orders, Only Valid Orders , or Exclude Invalid Orders.
Valid values for the parameter @Check = 'true', 'false' or 'all', for which I have added a radio button on the screen instead of a checkbox that I had earlier.
Default value of @Check = 'all'.
The function fn_CheckValid accepts an input of string and returns 0 or 1, based on whether the order is valid or invalid
My current AND condition in the select clause handles only the true or false condition
And (@Check = 0 or (fn_CheckValid(strOrder) = @Check))