eoneon123 Posted July 6, 2013 Posted July 6, 2013 Probably a super easy question but I cannot figure this out for the life of me. The short of it is that I'm trying to capture all records when a field value equals anything. I've tried using ALL, Any, and even Like "[a-z]%". Nothing seems to work. The bigger picture is that I'm using several global fields to filter a portal by the value list selections within said global fields. Given the selected values, I've got a calc field that captures a list of serials which filters in the portal. The issue is that for each of the global fields, I'm also using a "Show All" value that that effectively removes the global as a list condition. I'm not sure if thats clear but basically the set up is something like this: Let([ $GlobalValue1= "x"; $GlobalValue2 = Case(g_field2 = "Show All"; ALL; "y"); $GlobalValue3 = "z" ]; SQL ("SELECT id FROM Table WHERE Field1 = ? and Field2 = ? and Field3 = ?"; ""; ""; $GlobalValue1; $GlobalValue2; $GlobalValue3)) Any ideas?
Wim Decorte Posted July 7, 2013 Posted July 7, 2013 Seems to me that if one of the selections is "show all", you don't have to include the field in the query. So you can make the string after the WHERE dynamic based on the selections 1
eoneon123 Posted July 7, 2013 Author Posted July 7, 2013 That's the approach I've taken in the past, but making the WHERE parameter dynamic based on the contents of four fields seemed a little less simple than just capturing four variables and then plugging them into a static SQL statement. Plus, I just like to know what the limits are.
bruceR Posted July 7, 2013 Posted July 7, 2013 I don't think it affects your results but it seems odd to name something as global and then not define it as global. Like this statement: Let([ $GlobalValue1= "x"; I would suggest either truly making it a global: Let([ $$GlobalValue1= "x"; Or not calling it global: Let([ $Value1= "x"; 1
Recommended Posts
This topic is 4168 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 accountSign in
Already have an account? Sign in here.
Sign In Now