'Add integer value from another column to date in postgresql [duplicate]

I want to add the value of another colum (which is an an integer representing miliseconds) to a date value in an update query. I tried what this answer suggests but I can't find a way to not hardcode the value in the query but instead read it from the other column.

The two relevant fields are:

ScheduledExecuteDate: DATE(6)
RecurringInterval: INTEGER representing the number of miliseconds to add to the date

My query looks something like this:

UPDATE "Tasks" SET 
"ScheduledExecuteDate"="ScheduledExecuteDate" + interval ("RecurringInterval" / 1000) second 
WHERE "id" = 62

I've also tried 'second'. In both cases it throws an syntax error "at or near second" Also note that I have to wrap the column names in quotes since they are case sensitive.

I also tried

"scheduledExecuteDate"=DATE_ADD("scheduledExecuteDate", interval ("Tasks"."recurringInterval" / 1000) seconds)

like answered here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source