You are viewing limited content. For full access, please sign in.

Question

Question

"OR" Lookup in Forms

asked on October 20, 2016 • Show version history

Hi All,

We're looking to use two potential values to filter on a DB table in Forms. Through the lookup rules there is no way to set a lookup to filer on "Value A" OR "Value B". Effectively we are looking to run the following SQL command:

SELECT * FROM table WHERE column = 'Value A' OR column = 'Value B'

I've tried "tricking" it by setting a field to:

Value A' OR column = 'Value B

Hoping that it would just wrap the statement with apostrophes, but apparently it's a bit smarter than that wink

Has anyone got any ideas on how to acheive this? I'd prefer not to use a stored procedure if possible but at the moment I can't see any other way really.

Cheers! Dan

0 0

Replies

replied on October 20, 2016

There is no other way that I can think of. Stored Procedures are the way to go.

Also, you should be thankful your SQL injection trick doesn't work, because that would mean a whole host of bad things would be possible.

2 0
replied on October 20, 2016

Hmm that's a shame, thanks Scott!

And oh yeah, didn't really think about the security implications with that hahaha, good point.

Cheers, Dan

0 0
replied on October 21, 2016 • Show version history

Joking aside, are you looking for an alternative solution or have you got one sorted out already?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.