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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 | |
|
|