Deleting part of a MS Access Record
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 :)
Related Article: Microsoft Access Prevention of retrieving password
is a Databases discussion thread by jealii.jealii that has 1 reply, was last updated 4 months ago and has been tagged with the keywords: access, password, pass, word, microsoft, help, c, unix, linux, retrieve, code.
collin_ola
Junior Poster in Training
55 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
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!
BitBlt
Practically a Posting Shark
894 posts since Feb 2011
Reputation Points: 482
Solved Threads: 148
Skill Endorsements: 14
Worked perfectly, thanks a lot :D
collin_ola
Junior Poster in Training
55 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by
BitBlt