Amelia
Amelia

Reputation: 121

Adding days between dates

I am trying to add 14 days to the data that ranges from 01-JAN-2011 to 12-DEC-2018. Below is the query I wrote.

update (RENTAL_DATE +14) where RENTAL_DATE between '01-JAN-17' and '12-DEC-18'from MRE_COMP_DATA;

RENTAL_DATE IS A DATE COLUMN AND WE WANT TO ADD 14 DAYS TO IT.

Please let me know what I am doing wrong here.

Upvotes: 0

Views: 57

Answers (1)

DDS
DDS

Reputation: 2479

You just have used a wrong syntax::

UPDATE mre_comp_data
SET rental_date = rental_date + 14
WHERE RENTAL_DATE between '01-JAN-17' and '12-DEC-18'

Here is a link to PL-SQL update syntax: link

Upvotes: 2

Related Questions