Are you looking something like this:
What I could understand from question is, you have two seperate tables and want to sum a column value based on Order_Date filter (last six months) by joning two tables on Opportunity_ID.... Am I right?
In this case, SQL will look like this.
Select Sum(OPP.Expected_Amount)
From Opportunity OPP
Inner Join Sales SL
On OPP.Opportunity_ID = SL.Opportunity_ID
Where SL.Order_Date >= add_months(current_date,-6)
Are you looking something like this:
What I could understand from question is, you have two seperate tables and want to sum a column value based on Order_Date filter (last six months) by joning two tables on Opportunity_ID.... Am I right?
In this case, SQL will look like this.