Custom Reporting 13-3 Screen Help

I am a novice when it comes to custom report programming.  I hope that someone can help me with a formula in the custom report 13-3 screen in Sage 100.  This is the only tool we have to do the custom reports.  I want to combine the original budget from table BDGLIN with any added change orders from table SBCGLN.  The conditions are the cost codes need to be 30009 and 30010 and the status on the charge orders need to be 1 for approved.  The Primary Table I am using is the Accounts Receivable because it will be job based or job status selected.  I can get the Budget figures but I am having a hard time trying to connect the SBCGLN table.  Would I need to do an inner join?  If so I am not sure how to write it out in Sage so that It works.  What I need is the formula in the Job Summary report 6-4-21 that shows the new budget amount for each cost code, but that report does not open for me.  Below is my logic.  Hopefully someone can help me with a custom calculated field.

Gets me my original budget

[Select Sum(BdgLin.TtlBdg)From BdgLin Where BdgLin.RecNum = {ActRec.RecNum} and bdglin.cstcde = 30010]+[Select Sum(BdgLin.TtlBdg)From BdgLin Where BdgLin.RecNum = {ActRec.RecNum} and bdglin.cstcde = 30009]

I need help with this one to get the change orders added

My primary table Accounts Receivable connects to the Change Order table by
actrec.recnum = prmchg.jobnum

and the Change Order table connects to Sub Change Order Lines where the data is by
prmchg.recnum = sbcgln.recnum

I need to pull the data from sbcgln.bdgprc where prmchg.status = 1 & sbcgln.cstcde = 30010 and add it to the original budget.  I will also need to find any change orders that have 30009 as well and add it to the totals.  This will give me the "New Budget" that is on the Job Summary Report. 

Thank you in advance for any help you can give.  Have a great day!