Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Go back 8 quarters from current date

1723545Apr 10 2016 — edited Apr 13 2016

Hi

I have a situation where I need to get 8 quarters ( quarter is 3 months) from current date but if there are specific grades ( 90, 80) that the employee is in  , that entire quarter should be ignored.

For eg for the JOB rows as below, I need to ignore the last 2 quarters in 2014 , first quarter in 2014 and last quarter in 2013 (in bold). The desired output is 1/1/2013 here bcos he was in grades other than 80,90 since 1/1/2013 having completed 8 entire quarters in the desired grades. Please help

Emplid   effdt            effseq       Grade

10000    10/15/2015   0          10
10000    07/11/2015020
10000    4/19/2015022
10000    1/10/2015040
10000    11/11/2014090
10000    08/15/2014080
10000    06/1/2014030
10000    2/19/2014090
10000    12/13/2013090
10000    09/10/2013010
10000    05/16/2013010
10000    1/31/2013010
10000    10/1/2012020

Thanks!

This post has been answered by Solomon Yakobson on Apr 13 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 11 2016
Added on Apr 10 2016
49 comments
8,550 views