hi all
I don't know what is happening, please see the below commands for sample
Sample data and Query
with datum as
(
select '07/02/2020' rundate from dual
)
select rundate,
to_char(to_date(rundate,'mm/dd/yyyy') -1 ,'Mon-yy') date1 ,
to_char(add_months(to_date(rundate,'mm/dd/yyyy'),-1) ,'Mon-yy') date2
from datum
Query Result
rundate date1 date2
07/02/2020 Jul-20 Jun-20
My question is that why date1 is not doing minus 1 month. It was working fine before but now it is not working.
For testing I use different logic in date2 by using add_months and it is working fine. Please advise
Muz