waynefeltham
Programmer
Hi All
My first post here.
I've been struggling for several days now and still can't get this to work!
I have a form with 4 fields which represent the 4 columns in my DB that I want users to search.
AccountNumber
CompanyName
TelephoneNumber
PostCode
I want users to be able to enter search criteria in to as many or as few of the fields as possible. Also, the criteria they enter will not be complete words...so for example, they may enter the first 3 letters of the CompanyName and the last 5 characters of the telephone number.
All of the DB columns used in the search are stored as varchars (the AccountNumber isn't the primary key and most of them begin with 0 hence why it's a varchar).
The problem I'm having is writing the logic that determines if the user has entered something and then structuring the resulting query around this (ie. it would need additional WHERE LIKE clauses).
Can anyone help here?...Please!
Cheers
Wayne
My first post here.
I've been struggling for several days now and still can't get this to work!
I have a form with 4 fields which represent the 4 columns in my DB that I want users to search.
AccountNumber
CompanyName
TelephoneNumber
PostCode
I want users to be able to enter search criteria in to as many or as few of the fields as possible. Also, the criteria they enter will not be complete words...so for example, they may enter the first 3 letters of the CompanyName and the last 5 characters of the telephone number.
All of the DB columns used in the search are stored as varchars (the AccountNumber isn't the primary key and most of them begin with 0 hence why it's a varchar).
The problem I'm having is writing the logic that determines if the user has entered something and then structuring the resulting query around this (ie. it would need additional WHERE LIKE clauses).
Can anyone help here?...Please!
Cheers
Wayne