Hi Hannah
I think what you see is MapInfo Pro assigning a true/false or 1/0 value based on your expressions.
You can use John's approach and run multiple queries and update the table through these. Or you can use one of these approaches:
IIf
The IIf function is rather new to MapInfo Pro. It allows you to get one of two values returned based on a condition you pass to the function as well.
IIf(condition, true_value, false_value)
If the condition_expr is true, the true_value will be returned. Otherwise, the false_value will get returned.
Your expression in the Update Column Expression could look like this:
IIf((ColumnA = 1 or ColumnA = 6) and (ColumnB = 1 or ColumnB = 6) and (ColumnC = -1), 2, 0)
You might also use this condition where the current value of your column named ColumnD would be maintained:
IIf((ColumnA = 1 or ColumnA = 6) and (ColumnB = 1 or ColumnB = 6) and (ColumnC = -1), 2, ColumnD)
Where Condition
You can also a different approach which was made available through the SQL improvement we made in MapInfo Pro v2019. The Update statement now allows you to use Where expressions to control what records to update. This allows you to update parts of a table without running queries first, see John's suggestion.
To do this, you will however have to use the SQL Window as the standard Update Column dialog doesn't have a way for you to add a Where condition.
Your statement could look like this:
Update Table ABCD
Set ColumnD = 2
Where (ColumnA = 1 or ColumnA = 6) and (ColumnB = 1 or ColumnB = 6) and (ColumnC = -1)
HTH
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------