General information
Category:
Coding, syntax & commands
>
>|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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only