MSC_TIME_FISCAL_V

Details

  • Schema: FUSION

  • Object owner: MSC

  • Object type: VIEW

Columns

Name

CALENDAR_TYPE

CALENDAR_CODE

SEQ_NUM

YEAR

YEAR_START_DATE

YEAR_END_DATE

QUARTER

QUARTER_START_DATE

QUARTER_END_DATE

MONTH

MONTH_START_DATE

MONTH_END_DATE

DAY

WORKING_DAY

Query

SQL_Statement

SELECT calendar_type as calendar_type,

calendar_code as calendar_code,

null as SEQ_NUM,

YEAR as YEAR,

year_start_date as year_start_date,

year_end_date as year_end_date,

quarter as quarter,

quarter_start_date as quarter_start_date,

quarter_end_date as quarter_end_date,

MONTH as MONTH,

month_start_date as month_start_date,

month_end_date as month_end_date,

to_date(to_char(month_start_date+i,'DD-MON-YYYY'),'DD-MON-YYYY' ) as DAY,

null as WORKING_DAY

FROM (SELECT DISTINCT mcm.calendar_code,

mc.calendar_type,

concat('Year: ',mcm.year_start_date) as YEAR,

mcm.year_start_date,

mcm.year_end_date,

concat('Quarter: ',mcm.quarter_start_date) as quarter,

mcm.quarter_start_date,

mcm.quarter_end_date,

concat('Month: ',mcm.month_start_date) as MONTH,

mcm.month_start_date as month_start_date,

mcm.month_end_date,

mcm.month_end_date-mcm.month_start_date AS num_of_days

FROM MSC_CALENDAR_MONTHS mcm,msc_calendars mc

WHERE mcm.calendar_code=mc.calendar_code and mc.calendar_type=3

) T_NUM_DAYS,

xmltable('for $i in 0 to xs:int(D) return $i' passing xmlelement(d, num_of_days) columns i INTEGER path '.')