Hi gandolf989,LKBrwn_DBA,PMPAVB

Thank you for the idea. Actually, the table will have the record of transaction that happened on a partic-ular 'day' and it will increase/decrease the revenue column amount for each transaction.

for e.g.

Rep_Code Date Revenue Office
A 1-Jan-2013 0.5M NY
B 1-Jan-2013 0.3M CA
A 5-Jan-2013 1.0M NY
B 7-Jan-2013 1.0M CA
C 6-Feb-2013 0.8M MT
C 8-Feb-2013 1.0M MT
C 11-Feb-2013 0.98M MT
C 12-Feb-2013 1.0M MT

So, I want A>>5-Jan , B>>7-Jan and C>>8-Feb and no C>>12-Feb because it touched $1M again after 8-Feb. I need only the first date that it touched $ 1M.

So I need a working PL SQL script for achieving this.

Thanks,
Prathamesh Acharya