using dialog input to populate query
I am trying to use a user dialog to choose some options, and then use those options in a sql query. So the dialog box would be something like:
_________________________________________________________
mydialog = Dialog(
title( "Query" ),
vlist(
"Start date",
startdate = EditText( "m/d/yy" ),
"End date",
enddate = EditText( "m/d/yy" ),
Name1 = Check Box( "Tom", 1 ),
Name2 = Check Box( "Bill", 1 ),
Name3 = Check Box( "Mary", 1 ),
Name4 = Check Box( "Sue", 1 ),
),
hlist( Button( "OK" ), Button( "Cancel" ), ),
);
__________________________________________________________
Then I want to use the choices in a sql query something like:
SELECT * from tEmployees WHERE (ColumnName LIKE 'Name1' OR ColumnName LIKE 'Name2' OR ColumnName LIKE 'Name3') etc. etc.
I can make it work if the choices in the dialog are always the same. What I'm struggling with is adapting it to account for the user just selecting one name vs. all four names. I've been trying to get a for-loop to work but haven't had much success. Does anyone have any tips?
Thanks.
Clark