simoncpage
Programmer
Hi all, I am trying to work out how to search a string with sql to see if it contains a smaller string. For instance I wish to search to see if "dis" is contained in one of the fields in the access database description column. (and I would like to find entries like discontinued, disks, etc)
The idea I had was to search all the strings and split each search string into 3 parts ... so the string "Hello Test" would be split into
Hel
ell
llo
lo
...
etc
comparing each one to see if it equal the initial query "dis"
using the sql
strSELECT = "SELECT * FROM stock WHERE Ref = '" & txtRef.Text & "' "
where ref = search string (dis) and txtref will be the spliting up of the description string.
But I think that for large databases this will be a slow query..is there a quicker/easier way?
Any help would be appreciated!
Thanks
Simon
The idea I had was to search all the strings and split each search string into 3 parts ... so the string "Hello Test" would be split into
Hel
ell
llo
lo
...
etc
comparing each one to see if it equal the initial query "dis"
using the sql
strSELECT = "SELECT * FROM stock WHERE Ref = '" & txtRef.Text & "' "
where ref = search string (dis) and txtref will be the spliting up of the description string.
But I think that for large databases this will be a slow query..is there a quicker/easier way?
Any help would be appreciated!
Thanks
Simon