Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very Complex Query
Message
From
05/06/1997 09:43:45
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
 
 
To
05/06/1997 07:41:31
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00035136
Message ID:
00035169
Views:
34
>
>|SELECT main.code, invoice.invno, items.description, items.itemcode, qty AS |sum(items.qtyrcvd) ;
>| FROM main, invoice, container, items ;
>| WHERE main.code = invoice.code AND ;
>| invoice.contcod = container.contcode AND ;
>| container.itemcode = items.itemcode ;
>| ORDER BY code, invno, itemcode;
>| GROUP BY itemcode
>
>Then use a function to get each listing of invoices for each order and call it from the main header band: GetInvoice(code)
>|FUNCTION GetInvoice(tcCode)
>| LOCAL lcReturn, lcAlias
>| lcReturn = ""
>| lcAlias = ALIAS()
>| SELECT InvNo FROM invoice WHERE code = tcCode INTO CURSOR acTemp
>| SCAN
>| lcReturn = lcReturn + InvNo + " "
>| ENDSCAN
>| USE IN acTemp
>| IF !EMPTY(lcAlias)
>| SELECT (lcAlias)
>| ENDIF
>|RETURN lcReturn
>
>I think that will work, unless I'm misunderstanding your data structure

Thanks for the code looks like with some changes, it should work, but I will have to test it thoroly....

Will reply u again... thanks !!!
Previous
Reply
Map
View

Click here to load this message in the networking platform