I have an input date (say sysdate) and I want to get the date of the previous Monday. I tried
select trunc(sysdate, 'D') from dual;
but it is NLS dependent. Also I don't want to go around with checking the result by name because it may vary depending on the language of the country that my code will run on.
Try to use ISO weeks
SELECT TRUNC(SYSDATE, 'IW') - 7 previous_monday FROM dual
Here is SQLFiddle demo
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