Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date format

Lakshmi PFeb 27 2024

SELECT TO_CHAR(SYSDATE,'YYYYWW') START_wEEK
from DUAL;

--202409

-- Query extracting from 27Feb2024 Tuesday (Today)

SELECT TO_CHAR(SYSDATE-2,'YYYYWW') START_wEEK
from DUAL;

--202408

-- Query extracting from 25Feb2024 Sunday with sysdate -2

Both the queries should return 202409 which represents 9th week in the year. And it should consider Sunday to Saturday format, Sunday being the week start.

Please give me the right query.

This post has been answered by BluShadow on Feb 27 2024
Jump to Answer
Comments
Post Details
Added on Feb 27 2024
20 comments
507 views