Anindya,
Thank you so much for your effort.It will help, but still this method will make the records go up tremulously as the base table I am working on is COSS and COEP. It will multiply the total no of records by 16 at the least. I have replied to Lucas as he is suggesting the same.
My question is why nested if statement is producing wrong result? I would want to get it fixed with out increasing the row count.
Hope you understand .
Arthur.