How would I run an update query in Access 2000 to null all cells that contain a last name?

I would like to run an update query on a table that contains two fields. One field contains either
a last name or descriptors of multiple words. I would like to delete all last names, i.e. all cells in
the field that contain only one word. What would be the simplest way to achieve this update?
I primarily need to know what would go in the criteria field to null  the "last name" cells.
PDSWSSAsked:
Who is Participating?
 
Patrick MatthewsCommented:
UPDATE SomeTable
SET SomeColumn = Null
WHERE InStr(1, SomeColumn, " ") = 0


Now, anyone with 2+ word last names will slip through the net...
0
 
PDSWSSAuthor Commented:
Thanks for your quick response. Your code did the job.

Could you explain the logic  behind the code      (1, Column, " ") = 0

Thanks again.
0
 
PDSWSSAuthor Commented:
Thanks for your very quick response.
0
 
PDSWSSAuthor Commented:
mathewspatrick:

Could you also let me know what  the Where statement would be for an Update query that would delete those cells in the same
field I mentioned above where the word "trial" was one of the words in the cell.  Thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.