Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 921
- Office Version
- 365
- Platform
- Windows
Let's say we have 51 categories for Area, like, say, the states of USA. Now my programs wants to select all the people that lives in states that my user selected. Let's say those are "AR", "CO", "CA", "WY" or "HI". So far this is simple, right?
Now the part where I stick my finger into my mouth is that how do I do this in an SQL query? Hardcoding 51 OR-categories sounds more than stupid, and in my real problem I can't even know if there 1, 5, 15 or 51 of those "OR-categories".
Do we have some "is on the list"-operator in SQL? Can I just pass a typical VBA-array there?
Now the part where I stick my finger into my mouth is that how do I do this in an SQL query? Hardcoding 51 OR-categories sounds more than stupid, and in my real problem I can't even know if there 1, 5, 15 or 51 of those "OR-categories".
Do we have some "is on the list"-operator in SQL? Can I just pass a typical VBA-array there?