Compile a list of articles related to certain customers based on the customers' orders:
Code: Select all
SELECT "Customers"."Name","Customers"."Addr","Customers"."zip","Customers"."City","Articles"."Name","Articles"."Price"
FROM "Customers", "Articles", "Orders"
WHERE "Orders"."Cust_ID"="Customers"."ID" AND "Orders"."Art_ID"="Articles"."ID"
Since each customer gets another list of articles, this requires the report builder extension
http://extensions.services.openoffice.o ... portdesign which can print customer details and article details to different page sections. I'm not experienced enough with the report builder. You may ask in the Base forum if this type of serial letter is possible with it.
#############################################################
Compile a list of articles for all customers:
Code: Select all
SELECT "Customers"."Name","Customers"."Addr","Customers"."zip","Customers"."City","Articles"."Name","Articles"."Price"
FROM "Customers", "Articles"
100 Customers and 1000 Articles gives a total amount of 100,000 lines. The report builder extension should be able to compile 100 letters with a list of the same 1000 articles in this case.
Instead you may create an ordinary serial letter to all customers and insert the table of articles as a static copy into the serial letter. Drag the table/query icon from the left side into the text document.
Compile an ordered list of Articles with proper field names:
Code: Select all
SELECT "AID" AS "Order Number", "N" AS "Name", "Desc" AS "Description", "P" AS "Price", "C" AS "Category"
FROM "Articles"
ORDER BY "C" ASC, "P" ASC