Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Customer name with invoices
Message
 
To
13/10/2006 01:58:57
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01161652
Message ID:
01161684
Views:
18
This message has been marked as the solution to the initial question of the thread.
I believe that the solution is hand-craft.
Since Cross Tab solution is not applicable in this case.
Anyway, you can see Cross Tab Foundation Class.
Please check this sample:
#DEFINE INV_SEPARATOR ","

SELECT * FROM invoices ORDER BY cust_name, inv_no INTO CURSOR cur_invoices
CREATE CURSOR cur_aux (customer C(30), invoice C(254))

SELECT cur_invoices
DO WHILE NOT EOF()	
	cCust = cur_invoices.cust_name
	cInv  = ""
	DO WHILE NOT EOF() AND cCust = cur_invoices.cust_name
		cInv = cInv + IIF(EMPTY(cInv),"",INV_SEPARATOR) + ;
		       LTRIM(STR(cur_invoices.inv_no))
		SKIP
	ENDDO
	INSERT INTO cur_aux (customer, invoice) VALUES (cCust, cInv)
ENDDO
USE IN cur_invoices
SELECT cur_aux
*-- Your report here
the invoices column length is 254, the sample doesn't control that the amount of chars be bigger.



>Dear Experts
>
>On 25-10-2006, two customers (A & B) go to a departmental store to purchase some items, three times as
>
>custname--Invno
>A----------------1
>B----------------2
>B----------------3
>A----------------4
>A----------------5
>B----------------6
>
>Tble1 has two Fields as
>Cust_name c(30) && that is customer name
>Inv_no n(3) && that is Invoice number
>
>Now I want to generate a report showing customer name and their invoice numbers as
>
>A----------1,4,5
>B----------2,3,6
>
>Pleaes help
Previous
Reply
Map
View

Click here to load this message in the networking platform