• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

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.
  • 3
1 Solution
Patrick MatthewsCommented:
UPDATE SomeTable
SET SomeColumn = Null
WHERE InStr(1, SomeColumn, " ") = 0

Now, anyone with 2+ word last names will slip through the net...
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.
PDSWSSAuthor Commented:
Thanks for your very quick response.
PDSWSSAuthor Commented:

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now