entire report blank when no detail data exists

Icepickle

New member
Local time
Today, 06:24
Joined
Oct 21, 2004
Messages
5
I have a report that prints invoices, and in the page header area it contains most of the invoice information such as labor cost, customer info, etc. In the detail section of the report i have the line items, and a line contains a part, vehicle charge, etc. Some invoices dont have any line items though, and it seems that when there are no lines(ie. nothing in the 'detail' section), the header information will not appear either. Any ideas on how i can fix this?
 
Assuming that the Header and Lines are in two separate tables. You'll probably need to use an 'outer join' rather than an 'inner join'.

That way the header will print regardless on any line records.
If my assumtion is incorrect then, umm, I dunno! :confused:
 
yes they are in 2 seperate tables, and and this is the sql statement:

SELECT qPrintHeader.OrderNumber, qPrintHeader.status, qPrintHeader.bt_name, qPrintHeader.bt_id, qPrintHeader.bt_address, qPrintHeader.bt_city, qPrintHeader.bt_postal, qPrintHeader.st_name, qPrintHeader.st_id, qPrintHeader.st_address, qPrintHeader.st_city, qPrintHeader.st_postal, qPrintHeader.pstnum, qPrintHeader.DateIN, qPrintHeader.Comments, qPrintHeader.Performed, qPrintHeader.Model, qPrintHeader.Serial, qPrintHeader.System, qPrintHeader.HComments, qPrintHeader.Labor, qPrintHeader.[15discount], qPrintHeader.PO, qPrintLines.OrderNumber, qPrintLines.Name, qPrintLines.Quant, qPrintLines.Price, qPrintLines.Total, qPrintLines.GSTamount, qPrintLines.PSTamount, qPrintLines.sorthing
FROM qPrintHeader INNER JOIN qPrintLines ON qPrintHeader.OrderNumber = qPrintLines.OrderNumber;



Im assuming this is an inner join? im not aware of the difference between an inner or outer join, and i dont know how to make it an outer join. could you tell me how? thanks for all your help
 
ok.
In the design query screen Right-Click on the line that joins the two tables.
Select 'Join Properties'
Then select the option that says something like 'Include ALL records from 'qPrintHeader' and only those records from 'qPrintLines' where the joined fields are equal.

When the query is run you should have blank field where there is no line details.

The term 'outer join' should have been 'Left Join'. :o
 

Users who are viewing this thread

Back
Top Bottom