I previously wrote the following query which gives me that data I wanted and currently returns 436 records:
I would now like to add another field (man hours) that comes from a subquery. I'm running into a problem in that if the subquery does not have a value of man hours (SumOfSumOfhour s) for for the above query for a particular record then the whole record is not returned and it cuts my data down to only 202 records.
I would prefer it keep the record and either leave the field null or replace it with a 1. Is there a way to do this. The following is the state of the query when I became stumped. Please help. Thank you.
Code:
SELECT qryTonnageSelect.Jobs_Job_ID, qryTonnageSelect.SumOfTransactions_TonsNetWeight, qryProfitability.Margin, jcjob.name, qryProfitability.SumOfcost, qryProfitability.SumOfSumOfcost, qryProfitability.DollarMargin FROM (qryTonnageSelect INNER JOIN qryProfitability ON qryTonnageSelect.Jobs_Job_ID = qryProfitability.jobnum) INNER JOIN jcjob ON qryProfitability.jobnum = jcjob.jobnum ORDER BY qryTonnageSelect.Jobs_Job_ID;
I would prefer it keep the record and either leave the field null or replace it with a 1. Is there a way to do this. The following is the state of the query when I became stumped. Please help. Thank you.
Code:
SELECT qryTonnageSelect.Jobs_Job_ID, qryTonnageSelect.SumOfTransactions_TonsNetWeight, qryProfitability.Margin, jcjob.name, qryProfitability.SumOfcost, qryProfitability.SumOfSumOfcost, qryProfitability.DollarMargin, qryPaverHourGroupforTonsRep.SumOfSumOfhours FROM ((qryTonnageSelect INNER JOIN qryProfitability ON qryTonnageSelect.Jobs_Job_ID = qryProfitability.jobnum) INNER JOIN jcjob ON qryProfitability.jobnum = jcjob.jobnum) INNER JOIN qryPaverHourGroupforTonsRep ON qryTonnageSelect.Jobs_Job_ID = qryPaverHourGroupforTonsRep.jobnum ORDER BY qryTonnageSelect.Jobs_Job_ID;
Comment