Sherif - 8:03 pm on Aug 11, 2010 (gmt 0)
Yes... In most cases, there could be a payment or 2 for a product without an invoice number but it should be associated to the product, this situation generally happens when a customer pays a small down payment before we agree with him/her on the number of installments and their values. That was why I used a Right Join to get these payments.
The syntax that I used in the first post works fine, & outputs the desired results with the exception that when there is no match on the columns in the ON section of the query, the invoice_id, building_no, and apartment_no, are not printed (retrieved).
These values are crucial for later use as they are the unique number for the invoice related to each individual apartment, and therefore we will need it to associate the payment with the appropriate invoice when the customer comes to pay his/her installment.
Thanks for your patience and support up until this moment :) I really appreciate all of the support.