Header Ads

Header ADS

Calendar Date Print By Oracle SQL

Calendar Date Print By Oracle SQL

Topic Introduction: 'Calendar Date Print By Oracle SQL' here we will see how to print all date lists of a month according to calendars month and week, week start with Sunday. I have used Sysdate. you can use a date parameter to print out any month.



Calendar Date Print By Oracle SQL






SELECT Start_Date + LEVEL - 1 "List of Date"
FROM (
SELECT  NEXT_DAY ( TRUNC (SYSDATE, 'MONTH') - 7
, 'SUNDAY'
) AS Start_Date
, NEXT_DAY ( LAST_DAY (SYSDATE) - 1
, 'SATURDAY'
) AS End_Date
FROM    dual
)
CONNECT BY LEVEL <= End_Date + 1 - Start_Date
;




No comments

Theme images by Deejpilot. Powered by Blogger.