Okay, I know I need to qualify a variable to tell SQL what to do. So, if I have a text field and and a menu field on a form, then I will have
two name/value pairs. One for the text field and one for the menu. The
text field will just have a string value. I'm trying to determine what
values I would need for the menu under the following circumstances.
Here is a test URL to see what I'm trying to do:
http://www.dwayneepps.com/test/search.asp
I have "contains" for finding the string anywhere in the enteries of the
database search
I have "begins with" for finding the string only at the beginning of the
enteries of the database search
I have "ends with" for finding the string only at the end of the enteries of
the database search
and finally
I have "exact phrase" for finding the exact match of the string for the enteries
of the database search.
Right now, I have the value set to AND for "contains", "begins with" and
"ends with". Just as a placeholder. I have EXACT as the value for "exact phrase".
My question is:
Using the above two vaules from the form, what would be the right value to use for the menu in order to setup the correct SQL statement? Would I need to use wildcard values for the menu values?
For the SQL statement, I'm thinking it would be something like:
SELECT prod_number
From tblProducts
Where prod_number LIKE (textfield value variable) AND followed by the remaining part of the expression using wildcards from the values set in the menu (second variable).
I hope that makes sense? I'm in the infant stages of learning SQL so please forgive my lack of a clear explanation?
Any help is appreciated. Thanks.
-Dman100-