0
I am trying to make a script to change the year of a table record where the dta_shutdown field has the date in the format of 08/25/2091 13:06:00 in Oracle database.
I need to change the year 2091.
When I run the script below it changes the year but also changes the day, month and leaves without the time.
UPDATE tabela_aa SET dta_encerramento = TO_DATE('2018', 'YYYY') where dta_encerramento between '28-07-2017' and '29-08-2017';
I need to change record of several different days for the same year.
Do you have any way to make this not happen and manage to change only the year of the date that is in the table record?
Maybe add / subtract the required months. For example: adding 1 year would be the same thing as
somar 12 meses
, thus would not affect the remainder of the.– ThRnk
Maybe these links can help: https://dba.stackexchange.com/questions/48575/update-year-alone-in-date-oracle-11g/48604 https://asktom.oracle.com/pls/apex/asktom.search?tagchanging-a-year-within-a-date
– Neto Costa