1

I'd like to add 100 days to a field in a query:

SELECT DATE_ADD("date" + INTERVAL '100' DAY) FROM "history";

or whatever… but it doesn't work with the default HSQLDB frontend…

Any workaround ?

Bogey Jammer
  • 638
  • 2
  • 8
  • 23

2 Answers2

1

You don't need the date_add(), just add the interval to the column:

SELECT "date" + INTERVAL '100' DAY
FROM "history";
0

The default HSQLDB version in OpenOffic and LO is 1.8. It does not supports this function.

HSQLDB version 2.x supports several functions and expressions for date / time arithmetic.

If the column is named "date", this form is also supported. Note there is no underscore in the function name:

SELECT DATEADD('day',100, "date") FROM "history";
fredt
  • 24,044
  • 3
  • 40
  • 61