Jump to content

Dynamic SELECT using Let when WHERE clause might = anything


This topic is 4119 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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;

$B)

Link to comment
Share on other sites

This topic is 4119 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.