G
Guest
Is there a way to rule out combinations with out having to use an if then
block.
My form has 5 different text boxes. I want the user to enter the information
they wish to search by and have which ever text boxes that are not null have
that information passed to an SQL statement to search by.
The problem is, if I do an if then block for
txtdate
txtPIN
txtSN
txtTicketNumber
txtStaff
there's 125 possible combination of null vs not null within those 5 text
boxes. Is there any way to make an SQL statement that does something like
SELECT table.*
FROM table
WHERE field LIKE txtDate IF textbox NOT NULL AND field LIKE txtPIN....
instead of doing an if statement and SQL statement for each combination.
Is there a completely different way to do this and I'm just missing it?
-Thanks in advance.
block.
My form has 5 different text boxes. I want the user to enter the information
they wish to search by and have which ever text boxes that are not null have
that information passed to an SQL statement to search by.
The problem is, if I do an if then block for
txtdate
txtPIN
txtSN
txtTicketNumber
txtStaff
there's 125 possible combination of null vs not null within those 5 text
boxes. Is there any way to make an SQL statement that does something like
SELECT table.*
FROM table
WHERE field LIKE txtDate IF textbox NOT NULL AND field LIKE txtPIN....
instead of doing an if statement and SQL statement for each combination.
Is there a completely different way to do this and I'm just missing it?
-Thanks in advance.