If I understand correctly, you want to submit a SQL query from JMP using values held in a table. The code below uses a brute force approach to build the query string, and may give you some ideas. In this example, the values came from a user interface that required the user to select one and only one name, and one or more products.
reps = repsObj << GetSelected;
prod = prodObj << GetSelected;
if (NItems(reps)!=1, Beep(); Dialog("WARNING: You need to select a name"); Throw());
if (NItems(prod)<1, Beep(); Dialog("WARNING: You need to select at least one product"); Throw());
// Build the resulting query
SQLQuery = "SELECT * FROM Final WHERE salesrep_name = '"||reps[1];
if (NItems(prod)==1,
// Simple to build the query
SQLQuery = SQLQuery||"' AND product_group = '"||prod[1]||"';",
// else takes a bit more work
prodPart = "' AND (product_group = '"||prod[1];
for(i=2, i<=NItems(prod), i++, prodPart = prodPart||"' OR product_group = '"||prod[i]);
prodPart = prodPart||"');";
SQLQuery = SQLQuery||prodPart;
);
// Show(SQLQuery); // Debug