how to replace records with null

tigertim71

Registered User.
Local time
Today, 02:04
Joined
Apr 18, 2008
Messages
12
If I have 1000 records, of which I would like to replace 300 of a field with a null value to replace selected telephone numbers, how is this done (for all 300) using either (a) SQL viewer (or/and) (b) the query builder?

I would like to do all 300 in one go and only replacing the appropriate telephone number and keeping the rest of the field/record contents.
 
Top 300

How do you do TOP 300?

And what if all the telephone numbers are not in order? ie. not the TOP 300? Would I have to repeat this code for each one and how?

Code:
UPDATE Sheet4 SET ISBN = ' '
WHERE ISBN='02 678 3457';

Can the telephone number data for deletion be modified more easily?
 
What criteria are you going to use to select the Phone Numbers to clear? You set the order of your recordset with an OrderBy Clause in the query.
 
telephone numbers to clear

How would I do that? All the 1,000 numbers are different so the 300 would all be individual ones that need to be selected manually, initially finding out who the named person is and then relating that to the telephone numbers.

I could of course do this manually in the database...
 
How would I do that? All the 1,000 numbers are different so the 300 would all be individual ones that need to be selected manually, initially finding out who the named person is and then relating that to the telephone numbers.

I could of course do this manually in the database...

If you want to do it via query, you must first have a way to identify something that all 300 and ONLY all 300 have in common. Then a query likethe following would identify the 300 for you. Of course you would need to turn this into an Update Query as soon as you verified that the correct 300 records were selected.

Code:
Select PhoneNumber
From {YourTableName}
Where {Something the 300 have in common}

You could also create a temproary table with 300 entries that match a unique column in your table and join your table to this to select the records as well, but I think updating it by hand might be just as fast.
 
Since you have no criteria to pick and choose (to run a batch job in an update query) .....

... so the 300 would all be individual ones that need to be selected manually

Just place cursor in the table field and hit the delete key.

-dK
 

Users who are viewing this thread

Back
Top Bottom