PL/SQL (MOSC)

MOSC Banner

Query to fetch term from gl_periods

edited Apr 16, 2013 10:48PM in PL/SQL (MOSC) 10 commentsAnswered ✓
Hi Experts,

Need your help to extract specific terms from gl_periods based on given 2 periods

TERM1 : APR to SEP
TERM2 : OCT to MAR

If we input 'DEC-12' & 'FEB-13' >> expected result should be from OCT-12 to MAR-13 (6 months) (1 term)
If we input 'SEP-12' & 'APR-13' >> expected result should be from APR-12 to SEP-13 (18 months) (3 terms)

select period_year, period_name,decode(QUARTER_NUM,1,'TERM1',2,'TERM1',3,'TERM2',4,'TERM2') TERM, QUARTER_NUM
from gl_periods
where adjustment_period_flag='N'
and period_set_name='TSE ACCOUNTING'
and period_year in(select distinct period_year from gl_periods where period_name in ('DEC-12','FEB-13'))

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center