Wednesday, July 14, 2021

Query to get Date and Day from Given Date

 SELECT TO_CHAR(SYSDATE-TO_CHAR(SYSDATE,'dd')+LEVEL,'DD-Mon-YYYY')"DATE" 

      ,TO_CHAR(SYSDATE-TO_CHAR(SYSDATE,'dd')+LEVEL,'fmDay') "WEEK" 

  FROM dual 

 WHERE TO_CHAR(SYSDATE-TO_CHAR(SYSDATE,'dd')+LEVEL,'fmDAY') = UPPER('&DAY') 

       CONNECT BY LEVEL<=TO_CHAR(LAST_DAY(SYSDATE),'dd');

No comments:

Post a Comment

Query to get Parent and Child Accounts in Oracle APPS R12

SELECT ffv1.flex_value parent_account       ,ffvt1.description parent_account_desc   ,ffv2.flex_value child_account   ,ffvt2.description...