View Single Post
Old Dec 1st, 2006, 5:18 PM   #6
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4 mackenga is on a distinguished road
Having said that, a SELECT with only a LIKE in the WHERE clause and with % at the start and end of the operand to LIKE is going to be slow as hell. To refer back to the original question:

Quote:
is it possible to create an sql script that will search for a particular string in a database table (in ms access) and wil return the whole row of the string that is being searched?
Basically, the answer is Yes. That's the bread and butter of SQL.

Your query will start:

SELECT *

which means 'give me the values of all the columns for each row of the result'. Next up you want:

FROM tableName

(but replace tableName with the name of the table). Now you want to say something about which rows. Say you wanted to search a table called Customers for a row where Surname was Smythe:

SELECT *
FROM Customers
WHERE Surname = 'Smythe'

Well I hope this is helpful.
__________________
"I'm not a genius. Why do I have to suffer?"
mackenga is offline   Reply With Quote