Thanks for reply.I tried the query suggested but it is not working.May be the design of tables has some error.But if anyone has any other ideas please let me know.

Thanks in advance,
kadari.