calliepeck
04-12-2006, 12:33 PM
I have a filter set up to take a form field and stick it in a LIKE phrase between two % wildcards. This works great as long as the field value is in the middle of a result string. For example, searching for the terms 'all' returns entries with title 'callie'. However, if I search for 'cal', it will return an error since those are the first letters in the string. My filter is constructed as such:
else if (len(htitle)>0) AND (hcommittee="") AND (len(hdate)<4) then
response.Write("Results for hearings with title like '"& Replace(htitle, "'", "''") &"'")
Updater.Filter = "h_title LIKE '%"& Replace(htitle, "'", "''") &"%'"
How can I maintain the ability to search for strings in the middle of a field value, but not have it screw up any time i want to search for just the beginning or end of a field?
else if (len(htitle)>0) AND (hcommittee="") AND (len(hdate)<4) then
response.Write("Results for hearings with title like '"& Replace(htitle, "'", "''") &"'")
Updater.Filter = "h_title LIKE '%"& Replace(htitle, "'", "''") &"%'"
How can I maintain the ability to search for strings in the middle of a field value, but not have it screw up any time i want to search for just the beginning or end of a field?