Query not producing all records

jukus

Registered User.
Local time
Yesterday, 19:02
Joined
Jan 9, 2008
Messages
52
I have done some searches and found out about creating joins and have almost achieved the results I want. I have 4 tables (Invoices, Labor, Purchases, and Payments). All are linked by Invoice number and all of the data is enter via a form called invoices and has a subform for all of the other parts. I am creating a query to pull the total amount of the invoice from the parts of the table and then taking the payment and showing a report for this.

I created 4 total queries and then have nested them into a query. I then perform the calculations and have my results that I can then put into a report. Only problem is that if there is not data in the labor table for an invoice it does not show the invoice in the final query. Homever, if there is no payment data or purchase data it will show the invoice and leave those fields empty. Not sure why this is happening I used the same type of join on all of the queries.

Would love to try and understand why this is not working correctly. I can get around this by just entering a 0 for work hours on the subform, but I am thinking that there should be a way to this without doing that.

Anyway, if any one can help me understand the problem, it would be greatly appreciated.

I have attached a very scaled down version of the tables I am working with and the problem is in the InvoiceTotalsQuery. I have not performed the calculations in this, just want to see why invoice 7 is not showing.

Any help is greatly appreciated.
 

Attachments

I cannot understand why you have the Labour and Invoices tables in the final query.I removed them and got the followig result, is it what you expected.

InvoiceID Property SumOfWorkHours SumOfAmount
1 ABC Degrees 6 £56.00
2 Beacon Properties 4
3 Bud Inc 2 £49.23
4 ABC Degrees 2
5 Beacon Properties 0 £47.80
6 Bud Inc 4 £38.64
7 Bud Inc £22.50

Brian

Of course the Forum destroys any formatting.
 
Yes. That is what I was looking for. I used the Query Wizard and that is how the query came out.

Thanks. I myself was wonderig why they were in there but, I never thought to take them out.
 

Users who are viewing this thread

Back
Top Bottom