keepingbusy
Programmer
Hello guys
I am looking for some guidance on the following:
If I have two variables on a form, lets say msurname and mforename, the user can enter either or both to search. In this scenario, I would normally have a case statement that picks up which variable has been completed or not as the case may be:
Code:
* If the msurname is EMPTY....
CASE EMPTY(msurname) AND NOT EMPTY(mforename)
SELECT * FROM MYTABLE WHERE FORENAME=mforename ORDER BY ;
SURNAME ETC ETC
or
* If the mforename is EMPTY....
CASE NOT EMPTY(msurname) AND EMPTY(mforename)
SELECT * FROM MYTABLE WHERE SURNAME=msurname ORDER BY ;
SURNAME ETC ETC
* If both are used....
CASE NOT EMPTY(msurname) AND NOT EMPTY(mforename)
SELECT * FROM MYTABLE WHERE SURNAME=msurname AND FORENAME=mforename ;
ORDER BY SURNAME ETC ETC
Is there a way or some SQL command that caters for this.
I am looking to use about ten searchable fields in a table with Version 9 of VFOX.
I would appreciate some guidance on this.
Thank you
Lee