Query for report
490527Mar 2 2006 — edited Mar 3 2006I have a table with following data
Client Deal_No Order_No Deal_date
C1 D1 Ord1 01/03/2006
C1 D1 Ord2 01/03/2006
C2 D2 Ord3 01/03/2006
C3 D3 Ord4 01/03/2006
C4 D4 Ord5 01/03/2006
C4 D4 Ord6 01/03/2006
Here one client and deal_no can correspond to either 1 OR many Orders.
So only Order no differs in for rows with C1 as well as C4.
So,I want to generate a report which can show data either of the following format
(1)
Duplicate data should be displayed only once.
Client Deal_No Order_No Deal_date
C1 D1 Ord1 01/03/2006
Ord2
C2 D2 Ord3 01/03/2006
C3 D3 Ord4 01/03/2006
C4 D4 Ord5 01/03/2006
Ord6
Here Ord2 should be displayed below Ord1 and Ord6 below Ord5(could not maintain original formattting)
(2)
One row instead of many for
Client Deal_No Order_No Deal_date
C1 D1 Ord1,Ord2 01/03/2006
C2 D2 Ord3 01/03/2006
C3 D3 Ord4 01/03/2006
C4 D4 Ord5,Ord6 01/03/2006
Can anybody suggest a query?