Ask Your Question
0

SYNTAX TO ADD DAYS TO THE DATE IN QUERY

asked 2020-09-22 19:54:51 +0200

AMPVRAM gravatar image

i have to create a Maintenance Database schedule in Libre base , in this i have one requirement for query creation , when I enter the DONE ON DATE in the cell(column) the database must add the number of days specified in the INETRVAL DURATION and display the NEXT DUE DATE in the column. the purpose is for scheduling the periodic maintenance of our machinery.

My database table Looks like this with the below field names

DONE ON DATE | INTERVAL DURATION | NEXT DUE DATE

please let me know what syntax should i use.

thank you ..

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

answered 2020-09-25 04:17:35 +0200

gkick gravatar image

HI,

In case you are using HSQLDB 2.+ as a backend, this syntax should do

TO_CHAR( DATEADD( 'day', [interval], [last] ), 'DD/MM/YYYY' ). This is how i work out a due date for an invoice by adding payment terms to the invoice date. The TO_CHAR in front of the dateaddd will ensure you end up with a date and not an integer. Hope this helps

edit flag offensive delete link more
0

answered 2020-09-22 22:29:55 +0200

edit flag offensive delete link more
0

answered 2020-09-22 20:41:05 +0200

mgl gravatar image

Hello @AMPVRAM,

Have look at this post.

Kind regards, Michel

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-09-22 19:54:51 +0200

Seen: 54 times

Last updated: Sep 25