Show the Start Date and End Date of the Month
--
-- Show the Start Date and End Date of the Month
--
 
SET PAUSE ON
SET PAUSE 'Press return to Continue'
SET LINESIZE 300
SET PAGESIZE 60
 
SELECT 
  ADD_MONTHS (TRUNC (SYSDATE, 'MONTH'), i) start_date,
  TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE, i))) end_date
FROM XMLTABLE 
  ('for $i in 0 to xs:int(D) return $i'PASSING XMLELEMENT (d,FLOOR (MONTHS_BETWEEN (ADD_MONTHS (TRUNC (SYSDATE, 'YEAR') - 1, 12),SYSDATE)))COLUMNS i INTEGER PATH '.')
/


Published 1st January 2022

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License