I have a simple ship tracking dbase with a couple of tables. I have arrival and departure date fields.
I also have a duration field to store the number of days between the 2 dates.
Under tools → SQL I have the following code to update a single row.
UPDATE “AnchorageUsage”
SET “DURATION” =
(SELECT DATEDIFF(‘day’, “ARRIVALDATE”,“DEPARTDATE”) FROM “AnchorageUsage” WHERE “ID” = ‘1’)
WHERE “ID” =‘1’
It is limited by the WHERE clause to limit the rows returned to 1.
How do I update all rows in the table, or have button on form to update the duration field when I enter the departure date?
Thanks in Advance. The simpler answer that the better, as I’m a newbie to LibreOffice.