to_char(sysdate,'Day')
returns the current day of the week. What I want is to get the date
of the most recent "sunday" that passed. Of course we can go for a complex query to get it done. But is there any simple way I'm not aware of?
You can do it with
SELECT NEXT_DAY(SYSDATE-8, 'SUN') FROM DUAL;
here
SYSDATE-8
returns the day before 8 days &
NEXT_DAY(mydate, 'SUN')
returns the next sunday to it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With