select statement with group by and join source with two data source in report

Dear all,

I have one table and there are so many records of amount and in other table there are divisions of that records but only one field in common between both tables like user id . And in this report i want to take division from first table and sum of all the records available in other table of that division so i want to write code over there to show on the report if there is any other way for this or i can write by using aggregate function i.e. like sum then please help me.

Thanks

Anil Chauhan

Are you working on reports of AX 2012, using Visual Studio.

Thanks,

Preeti

this is report for ax2009