Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted
Hey guys, I was wondering if anyone knew the answer to this problem. I'm trying to generate a value list based on a checkbox field in another table. I know how to achieve the value list portion of it, as this works when I change the checkbox field to a text field with a single value. But I can't seem to avoid getting the "?" when I use a checkbox field for the WHERE criteria. Any ideas? 
 
Let([
 
      ~sql = " SELECT Field1 FROM Table1 WHERE CheckboxFieldValue = ?"
 
      ];
 
      ExecuteSQL ( ~sql ; "" ; "¶" ;  "Value" )
 
      )
Posted

remember a check box field is a normal field with return separated text, so the if the checkbox field had 

 

cat¶dog¶mouse all selected and you are trying to find dog you may need to use a more loose search because the the contents doesn't equal the string.

 

or you may need to create a Field that uses pattern match such as isDOG and results to a boolean. using that in your sql.

Posted

Sorry to be dense, but what do you mean by a "more loose search"? I'm pretty new to SQL. I'm equally confused as to the second alternative. 

Posted

i was thinking of the LIKE operator

 

http://www.w3schools.com/sql/sql_like.asp

 

-

If your searching for DOG via SQL create a field that is: PatternCount ( table::CheckBoxFieldValue ; "dog" ) this field will evaluate to 1 or 0 use it in your field

 

Let([
 
      ~sql = " SELECT Field1 FROM Table1 WHERE isDOG = ?"
 
      ];
 
      ExecuteSQL ( ~sql ; "" ; "¶" ;  "1" )
 
      )
Posted

I'm going to work on the second option now, but the query worked when using the "LIKE" operator. Just one quick question, what if I wanted to use a global variable as a match for the CheckboxFieldValue? Meaning, how do I frame the WHERE Value and the % operator when said Value is a global variable? By the way, thanks so far for the help.

 

 

Let([
 
      ~sql = " SELECT Field1 FROM Table1 WHERE CheckboxFieldValue = ?"
 
      ];
 
      ExecuteSQL ( ~sql ; "" ; "¶" ;  $$Value% )
 
      )
 
 
Posted

I downloaded both files and will take a deep look into them but it looks like the pattern count method was the way to go. Thanks again for the help!

This topic is 4400 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.