Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete data from certain fields 1

Status
Not open for further replies.

mrt1

Technical User
Feb 9, 2007
2
US
I have a table in Access 2002 that includes several date fields, including "deposit". The records also include a "location" field for one of four possible building sites. For records at "location x", the "deposit" fields were inadvertently populated with data - they should have been left blank - about 1500 of 5000 records. Other records for "location y" and "location z" have the correct dates in the "deposit" field and cannot be changed.

Is there any way I can delete the all the values in the "deposit" field for "location x" and leave the "deposit" data for the other locations alone?
 
Something like this?

Code:
update table
set deposit = ''
where location = 'LocationX'

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
if deposit is a date field, as mentioned, then i rather suspect that setting it to an empty string will fail

how about setting it to NULL instead

;-)

r937.com | rudy.ca
 
[blush]

Yeah, setting the date column to null will work better I think.

Never take advice from a man who cannot read.

Ignorance of certain subjects is a great part of wisdom
 
Thanks for the help. I tried AlexCuse first suggestion and it worked fine on a copy of my database. If I run into trouble with any of the empty string date fields, I'll try the second on another copy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top