April15Hater
Accountant
- Local time
- Today, 05:57
- Joined
- Sep 12, 2008
- Messages
- 349
Hi-
I am trying to run a regular tabular query (qtrJobSheet) that contains two crosstab queries (qxtFunctionPrice and qxtFunctionCost). Both crosstabs return matching records but whenever I run the tabular it it returns zero records where I know it should be returning several. The crosstabs to have a variable amount of columns and I think htat might be the culprit. I've searched around but don't know what exactly to search for. Any ideas guys?
Here is the SQL code for the tabular:
Here is the SQL for qxtFunctionPrice:
and the sql for qxtFunctionCost
I am trying to run a regular tabular query (qtrJobSheet) that contains two crosstab queries (qxtFunctionPrice and qxtFunctionCost). Both crosstabs return matching records but whenever I run the tabular it it returns zero records where I know it should be returning several. The crosstabs to have a variable amount of columns and I think htat might be the culprit. I've searched around but don't know what exactly to search for. Any ideas guys?
Here is the SQL code for the tabular:
Code:
SELECT [tblClient].[EndCustomer] & " (" & [ClientLocation] & ")" AS ClientName, tblJob.JobName, tblFunction.[Function Name], qxtFunctionCost.*, qxtFunctionPrice.*
FROM (tblClient INNER JOIN tblJob ON tblClient.ClientID = tblJob.ClientID) INNER JOIN (qxtFunctionPrice INNER JOIN (qxtFunctionCost INNER JOIN tblFunction ON qxtFunctionCost.FunctionID = tblFunction.FunctionID) ON qxtFunctionPrice.FunctionID = tblFunction.FunctionID) ON tblJob.JobID = tblFunction.JobID;
Code:
TRANSFORM Sum(tblPriceFunction.FunctionPrice) AS SumOfFunctionPrice
SELECT tblFunction.FunctionID, tblFunction.JobID
FROM tblFunction INNER JOIN tblPriceFunction ON tblFunction.FunctionID = tblPriceFunction.FunctionID
GROUP BY tblFunction.FunctionID, tblFunction.JobID
PIVOT tblPriceFunction.FunctionType;
Code:
TRANSFORM Sum(tblContractorFunction.FunctionCost) AS SumOfFunctionCost
SELECT tblFunction.FunctionID, tblFunction.JobID
FROM tblFunction INNER JOIN tblContractorFunction ON tblFunction.FunctionID = tblContractorFunction.FunctionID
WHERE (((tblFunction.JobID)=20))
GROUP BY tblFunction.FunctionID, tblFunction.JobID
PIVOT tblContractorFunction.FunctionType;