A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find and replace unique records



 
 
Thread Tools Display Modes
  #1  
Old August 17th, 2007, 01:53 AM posted to microsoft.public.access
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default Find and replace unique records

You can use the IN operator with a value list to return rows where a value in
a column matches any one of the values in the list, e.g.

UPDATE YourTable
SET Status = "Cancelled"
WHERE [Account Number] IN(123,456,789);

If the account number is a text data type wrap the values in quotes:

WHERE [Account Number] IN("123","456","789");

Is there no other criterion which can be applied to other columns in this or
related tables to identify the set of rows to be updated without having to
specify the account number of each?

Ken Sheridan
Stafford, England

"matt22" wrote:

I have a table with a field called "Status" whose values are Active and
Cancelled. The default value for this field is Active. I have found that
several hundred records need to be changed to Cancelled. Is there a way I can
use an update query to search for records by the Account Number field, unique
to each record, and change the value in the "Status" field to Cancelled. The
update query example that I have seen search using only one value.

Thanks.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.