G
glnbnz
I have a select query that runs like this:
SELECT [P - Lease Info].Num, qryTest1.Lease, tbl1BeginStock.BeginStock,
qryNetBbls.SumOfMiscBbls, qryTest1.SumOfEndStock,
qryNetBblsRun.SumOfNetRunsBbls, qryNetBbls.SumOfNetProdIn,
qryNetBbls.SumOfNetProdBbls,
(([SumOfMiscBbls]+[SumOfNetRunsBbls]+[SumOfEndStock])-[BeginStock]) AS Total,
([SumOfNetProdBbls]-[Total]) AS Diff
FROM (((qryTest1 INNER JOIN tbl1BeginStock ON qryTest1.Lease =
tbl1BeginStock.Lease) INNER JOIN qryNetBbls ON qryTest1.Lease =
qryNetBbls.Lease) INNER JOIN qryNetBblsRun ON qryTest1.Lease =
qryNetBblsRun.Lease) INNER JOIN [P - Lease Info] ON qryTest1.Lease = [P -
Lease Info].Lease
ORDER BY [P - Lease Info].Num;
I have over 200 leases. In every table or query there is a value listed
except qryNetBblsRun. In a month there may not be a record in that table. I
would like the query to list all of the leases, but since some leases have no
record in qryNetBblsRun it only lists ones that have an entry so right now
there is only 83 records showing. Is there a way to write the query to put a
zero in for those remaining leases that have no record?
Thanks
SELECT [P - Lease Info].Num, qryTest1.Lease, tbl1BeginStock.BeginStock,
qryNetBbls.SumOfMiscBbls, qryTest1.SumOfEndStock,
qryNetBblsRun.SumOfNetRunsBbls, qryNetBbls.SumOfNetProdIn,
qryNetBbls.SumOfNetProdBbls,
(([SumOfMiscBbls]+[SumOfNetRunsBbls]+[SumOfEndStock])-[BeginStock]) AS Total,
([SumOfNetProdBbls]-[Total]) AS Diff
FROM (((qryTest1 INNER JOIN tbl1BeginStock ON qryTest1.Lease =
tbl1BeginStock.Lease) INNER JOIN qryNetBbls ON qryTest1.Lease =
qryNetBbls.Lease) INNER JOIN qryNetBblsRun ON qryTest1.Lease =
qryNetBblsRun.Lease) INNER JOIN [P - Lease Info] ON qryTest1.Lease = [P -
Lease Info].Lease
ORDER BY [P - Lease Info].Num;
I have over 200 leases. In every table or query there is a value listed
except qryNetBblsRun. In a month there may not be a record in that table. I
would like the query to list all of the leases, but since some leases have no
record in qryNetBblsRun it only lists ones that have an entry so right now
there is only 83 records showing. Is there a way to write the query to put a
zero in for those remaining leases that have no record?
Thanks