VbzCart/docs/queries/qryRpt Pkg Trx

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Revision as of 23:27, 1 June 2011 by imported>Woozle (SQL from MS Access -- not tested on MySQL yet)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<mysql>SELECT t.ID_Order, tt.Code, t.WhenDone, iif(t.ID_Package IS NULL,"","pkg #"&p.Seq&": ")&t.Descr AS Descr, t.Amount FROM (ord_trxact AS t LEFT JOIN ord_trx_type AS tt ON t.ID_Type=tt.ID) LEFT JOIN ord_pkgs AS p ON t.ID_Package=p.ID WHERE WhenVoid IS NULL ORDER BY WhenDone, Amount>0; </mysql>