Aging query is quite huge and complex, and it changes with the parameters you enter.
Better to enable SQL Trace and run Aging bucket report.
You will get the query.
Yah I know it huge but I found a query that is working fine with me instead of sql trace
Thanks a lot for your help and let me know incase you need this query