BASE How to copy one date to all records in a column?

In BASE – If a table has many records, how can all records in a table column be updated with a single date, without pasting the date to each record individually?

image description

Hi, use an update statement like

UPDATE “yourtable” SET “yourfield” = CURDATE()

This statement needs to be run from Tools, SQL or the statement can be placed inside the code of a macro.
Depending on your local settings you may need to adjust for the format of the date
e.g. UPDATE “tblAlpha” SET “ndate” = ‘2020-12-20’

That worked!… To set today’s date. But, how would I specify a specific date?

I tried the other suggestion, using “ndate” but it didn’t work. I also tried DATE(2020-10-20) instead of CURDATE(). That didn’t work either. Sorry to be nit picky… I’m not the SQL expert.

With DATE, I also tried separators like 2020;10;20, 2020/10/20, 2020.10.20… etc. All rejected.

Hi , the above syntax is for HSQL database embedded 1.8 or backend.2.5
UPDATE “yourtable” SET “yourfield” = ‘2020-11-12’ works on my machine win10, LO6.4. embedded and backend.
The date format depends on your local settings. Did you type the ’ ’ between the date ?

Thanks @gkick… that worked for me too. Someday, my brain will adjust to SQL illogic. (Haha) Or, perhaps getting to, at least, a basic understanding of the language.

Thanks to @gkick.

Using LO v7.0.2.2 (x64) (latest version as of Oct 2020)

To update all entries in a table [DATE] column with a single chosen date, the following SQL worked for me.

For today’s date…
UPDATE “your_table” SET “your_field” = CURDATE()

For a choice of dates…
UPDATE “your_table” SET “your_field” = ‘2020-10-20’