TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
travis.hurst
NA
13
0
Wildcard Searching
Oct 15 2004 10:14 AM
Hello, I am trying to add wildcard searching facilities to my search screen. I want to use % for searching on forname and surname. eg Bra% UPPER (FORENAME) LIKE 'BRA%' - Bradley - Bradshaw but also %MAD% -- Maddison -- Lomad Below is my existing search method ========================== private string BuildSearchSQL() { string strSQL; string strSQLSelect; string strSQLFrom; string strSQLWhere; strSQLSelect = "SELECT p.id, p.title, p.forename, p.surname, bu.unit_name, l.location, t.team_name "; strSQLFrom = "FROM PERSON p, VEC_BUSINESSUNIT bu, VEC_LOCATION l, VEC_TEAM t "; strSQLWhere = "WHERE p.BUSINESSUNITID = bu.ID(+) "; strSQLWhere += "AND p.LOCATIONID = l.ID(+) "; strSQLWhere += "AND p.TEAMID = t.ID(+) "; if (cboTitle.Text.Length != 0) strSQLWhere += "AND p.TITLE = '" + cboTitle.Text + "' "; if (txtForename.Text.Length != 0) strSQLWhere += "AND UPPER(p.FORENAME) = '" + txtForename.Text.ToUpper() + "' "; if (txtSurname.Text.Length != 0) strSQLWhere += "AND UPPER(p.SURNAME) = '" + txtSurname.Text.ToUpper() + "' "; if (cboBusUnit.Text.Length != 0) strSQLWhere += "AND UPPER(bu.unit_name) = '" + cboBusUnit.Text.ToUpper() + "' "; if (cboLocation.Text.Length != 0) strSQLWhere += "AND UPPER(l.location) = '" + cboLocation.Text.ToUpper() + "' "; if (cboTeam.Text.Length != 0) strSQLWhere += "AND UPPER(t.team_name) = '" + cboTeam.Text.ToUpper() + "' "; strSQL = strSQLSelect + strSQLFrom + strSQLWhere; return (strSQL); }
Reply
Answers (
1
)
Date validation
perform a keypress