Deleting Column Contents

Dave Titan

Registered User.
Local time
Today, 18:37
Joined
Jan 1, 2002
Messages
69
Looks like the thread never went through!

Question was how to delete the contents of a column in a table. Nothing happens when delete is pressed and the contents are highlighted. I need to keep some some columns of information but delete others. And cannot allow records to be deleted.

I know there must be an easy answer, but it's not in my head!
 
If you want to remove all the information in a column in a table:
UPDATE MyTable
SET MyCol = NULL

Will NULL the column in ALL THE ROWS
If it is numeric you can set it to 0 (zero) instead,
if NULLs are not allowed, you can set it to an empty string ("") given it is a string or memo. You can limit the rows effected by using the where clause of the query.

Is this what you are looking for?
 
I believe it is thank you. However I a little lost as to where I'm to imput what you suggested?
 
FoFa's suggestion is to create an update query. Update queries change values en masse. Read up in the Access help about them.

If you're looking for a really quick way to delete the contents of an entire column, and it's not involved in any relationships, you might want to consider deleting the column then recreating it. :)
 
Thanks I will create the query first.

Another option I discovered was to cut the fields and then paste them back in again. This way the data is deleted and the field is still saved in masse.
 

Users who are viewing this thread

Back
Top Bottom