I am using Excel to access a Sql database in an effort to get the report I am looking for. However, I believe I have bit off a little more than I can handle when it comes to writing the sql statement this is what I have so far:

[vba]
strSQLJE = "SELECT Orders.StatusDate, Orders.JobNumber, Customers.CompanyName, Orders.AccountNo, Orders.QuotePrice " & vbNewLine & _
"FROM Orders " & vbNewLine & _
"INNER JOIN Customers " & vbNewLine & _
"ON Orders.CustomerID = Customers.CustomerID " & vbNewLine & _
"WHERE Orders.StatusID = '3' AND Customers.ClassificationID = '1' AND StatusDate BETWEEN '" & ReportForm.SDate.Value & "' AND '" & ReportForm.EDate.Value & "'"
[/vba]

This gives me the records that I want; however, I am trying to back out a certain cost that is tied to resource type. These are the other fields that I think are needed to accomplish this are the following:

ResourceFPSDetail.ResourceClickCharge
ResourceFPSDetail.ResourceID
OrderStockDetail.NumImpressions
OrderStockDetail.OrderID
OrderStockDetail.ResourceID
Equipment.ResourceID
Equipment.ResourceType

What I would like is for it to take OrderStockDetail.NumImpressions * ResourceFPSDetail.ResourceClickCharge WHERE Equipment.ResourceType <>3 and Sum that total for each record and create a column for that total. Then create a column for Orders.QuotePrice minus that Sum.

Is this possible or is this so complicated that I should find another way?