2 Fields
Field 1 = “Match - Tree Owner”
Field 2 = “Ancestry Name”
If “Match - Tree Owner” is equal to WHM
Then I would like to populate “Ancestry Name” with Mello, Bell, Weeks
Else leave blank and to be populated manually
Hello,
Some guessing done here as no database type was given.
Note that a query is not wanted for that is a select and an ‘IF’ statement is not used but rather a ‘Where’ condition.
So here is an UPDATE statement using a table name of “TestSQL”:
UPDATE "TestSQL" SET "Ancestry Name" = 'Mello, Bell, Weeks' where "Match - Tree Owner" = 'WHM'
Data before running:
Data after:
This cannot be run in the query section. Instead run from main Base menu item Tools->SQL...
It is always best to backup your data before running any mass updates.
This cannot be run in the query section.
That is a good rule of thumb but not always the case: openoffice.org - How to create an update query with Open Office Base? - Stack Overflow