Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display header data even if there is no record.

Status
Not open for further replies.

ngcn

MIS
Apr 29, 2002
33
MY
Hi all,

Does anyone knows how to display header data if there was no record found ?? I am using Crystal Report 8.5 & VB6 form to filter report. The header data are extracted from 3 different tables in database, one of the table is the transaction tables that i am extracting its records from. The user wants to display data from the other 2 non transaction table if there is no record found in the transaction table.

*example of report

Vehicle Transaction Report

Vehicle No : {Vehicle.No} Mfg Year : {Vehicle.MfgYr}
----------------------------------------------------------
1. {Transcation.Desc1}
2. {Transcation.Desc2}
----------------------------------------------------------

Thanks for the help.

Have a nice day ! [spin2]
 
Try posting the type of database and connectivity since that's what your uestion is about.

If you use a Left Outer join from the other tables to the transaction table, you'll still get the other tables data when there aren't transactions (details).

Try posting example data and expected out if you want to give people an understanding of your environment and requirements:

-k
 
Thanks for ur fast response, below is the sql statement.

sql="SELECT v.vehicle_Code, v.yearmfg,c.description,t.catcode,t.vehno,t.tdate
FROM Category c
inner join Vehicle v on (c.category_code=v.category_Code)
left outer join VTransansaction t on (t.VehNo=v.VehNo)
WHERE t.TransDate >DateFrm and t.TransDate <=DateTo
and t.vehno='px 333'"

These are the table structure :

Category Vehicle VTransaction
-------- ------- ------------
Category_Code --Key VehNo--Key TransNo--Key
Description Category_Code VehNo
YearMfg TransDate
Repair_Amt
Repair_Desc1
Repair_Desc2

The report will still display the header although there's no transaction record :

Vehicle Transaction Report

Vehicle No : {Vehicle.VehNo} Mfg Year : {Vehicle.YearMfg}
Category No : {Category.Category_Code}
----------------------------------------------------------
1. {VTranscation.Repair_Desc1}
2. {VTranscation.Repair_Desc2}
----------------------------------------------------------

regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top