Hey Richard,I trying to generate an "Customer Billing History Query" that display client's Billing and Finance Info. I can't figure out the best way to get the correct results.
Kevin Robertson
What have you tried?
Screenshots?
James Hopkins
James Hopkins
James Hopkins
James Hopkins
Also, I am trying to create an "Client Billings Summary Query" that displays the 'Balance, Available Credit, & Most Recent Payment. What is the best way to get this done correctly?
James Hopkins
Hey Guys, is there a good way to get this accomplish Correctly? Any Help is welcomed, thanks in advance.
Kevin Yip
I would suggest you split invoices and payments into two tables. One payment may be applied to multiple invoices, and multiple payments may be applied to one invoice. In my old job, this happened all the time. A customer would have 5 outstanding invoices, and wrote only one check to pay for all of them. He might also make several partial payments for one invoice. Your PaymentT wouldn't be able to deal with those scenarios. These are very real real-life situations so your database must accommodate them.
First you need a separate invoice table that contains only info of each invoice. You may already have this table set up, and it should look something like: InvoiceID (Primary Key), InvoiceDate, InvoiceAmount.
Then you need a payment table that contains info of each payment: PaymentID (PK), ClientID, PaymentDate, PaymentAmount, etc.
Finally you need a "child" table for your payment table to store how each payment is applied to each invoice: PaymentID (PK), LineNum (PK), InvoiceID. Line_Num is a counter for each PaymentID. For instance:
This is what you see when one payment covers multiple invoices:
PaymentID LineNum InvoiceID
123 1 10001
123 2 12000
123 3 34001
123 4 10011
This is what you see when multiple payments cover one invoice:
PaymentID LineNum InvoiceID
124 1 10001
125 1 10001
126 1 10001
127 1 10001
Note that PaymentID-LineNum combo is always unique, and should be, because they are the primary keys.
AND FINALLY, to accomplish your original goal of finding the balance of a customer.... I'll have to save it for another post, hopefully later today. Take a look at the above first, and see if that's the route you want to take.
James Hopkins
Thank you guys for your help and Time..
James Hopkins
James Hopkins
I am trying to figure out how can I retrieve "Date, Activity Type (Invoice, Payment, or Credit)", "Description or Notes", "Amount" & "Balance" from the different Tables. I am trying using a Query to achieve this to display the Data Results in a Form.
Kevin Yip
You can use a union query to combine data from multiple tables. If you have a payment table (PaymentID, PaymentDescription, PaymentAmount) and an invoice table (InvoiceID, InvoiceDescription, InvoiceAmount), you can make a union query to combine them and make them appear as if it is one table: SomeID, Description, Amount. Union queries are quite involved so you need to take Richard's courses.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access TechHelp.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.