1.11M Members

Deleting part of a MS Access Record

 
0
 

Hi,

I am having problems with deleting part of a record. The record has approximately 15 different fields, and I only wish to delete 3 of them using the following piece of SQL coding:

DELETE [PMID 1], [PMName 1], [Price 1] FROM Subscriptions WHERE [Customer ID]="001"

The code works absolutely fine, but it just doesn't do what I want it to. Instead of deleting those 3 fields, it deletes the entire row, which isn't very helpful.

Any ideas on how to solve this problem?

Thanks in advance :)

 
1
 

The SQL statement "DELETE" is used to remove an entire row. It appears what you want is to set values in specific columns of an existing row to NULL. You do this with an UPDATE statement. Try this:

UPDATE Subscriptions
set [PMID 1] = NULL, [PMName 1] = NULL, [Price 1] = NULL
where [Customer ID] = "001"

You just have to make sure that the columns allow for NULL (as in "Allow Zero Length" set to Yes in the table definition.

Hope this helps! Good luck!

 
0
 

Worked perfectly, thanks a lot :D

Question Answered as of 2 Years Ago by BitBlt
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: