February 4, 201312 yr I'm trying to create a dynamic SELECT set up by way of the Let function where the SELECT values are the results of Let variables. The problem is that sometimes these values equal "all" or "empty". In these cases, I basically just want to ignore that value in the WHERE criteria. I tried setting it up using a Case function so that if the value equaled "all" or "empty" the result would be an "*" but that didn't return anything. Let([ $a = Case( FieldValue1 = "all" or FieldValue1 ="empty"; "*"; FieldValue1); $b = Case( FieldValue2 = "all" or FieldValue2 ="empty"; "*"; FieldValue2) ]; SELECT FieldA, FieldB FROM Table WHERE $a; $
February 4, 201312 yr You can have the word "WHERE" be conditional as well if it equals all or empty.
February 4, 201312 yr Author Right! I don't know how I overlooked that trick but I'm pretty sure it will go a long way to simplifying my calcs/scripts. Thanks again!
Create an account or sign in to comment