Grouping Problem with QR2 and Delphi3
Hey everyone,
I have the following problem:
I have 3 tables:
- MasterTable, (OrderNo,...)
- DetailTable, (OrderNo,Position,...)
- DetailTextTable, (OrderNo,Position,SubPosition, Text)
I want to print out a distinct order with all its detail-records AND (if
there are)
the Texts associated with a detail-position.
To get the neccessary information I do a query like:
SELECT * FROM MasterTable M, DetailTable D, DetailTextTable T
WHERE
(M.OrderNo = 1000) AND
(M.OrderNo = D.OrderNo) AND
(D.OrderNo = T.OrderNo)
To get the information printed I have a Report with several Group-Bands
- GroupMaster (Expression = Query.OrderNo) :Type GroupHeader
- GroupDetail (Expression = Query.Position) :Type GroupHeader
- GroupDetailTexts (Expression = Query.Position_1) :Type GroupHeader
- TextsBand : Type DetailBand
The problem is:
Although not every Position of DetailTable has corresponding records in
DetailTextTable, the DetailTexts are printed out repeatedly for EVERY record
of DetailTable.
e.g.
OrderNo 1000
=============
Position 1
-----------------------
Position 1 Text 1
Position 1 Text 2
-----------------------
Position 2
-----------------------
Position 1 Text 1 - THIS IS WHAT SHOULD NOT HAPPEN
Position 1 Text 2 - POSITION 2 HAS NO ENTRIES IN DetailTextTable
-----------------------
What am I doing wrong? Any Help appreciated!!
--
Have fun
Hanz
beconsult...@gmx.de