VbzCart/docs/queries/qryRpt Pkg Trx: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (SQL from MS Access -- not tested on MySQL yet) |
imported>Woozle (tidied up but still not converted to MySQL) |
||
Line 1: | Line 1: | ||
<mysql>SELECT t.ID_Order, tt.Code, t.WhenDone, iif(t.ID_Package IS NULL,"","pkg #"&p.Seq&": ")&t.Descr AS Descr, t.Amount | ==About== | ||
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 | * '''Requires''': {{vbzcart|table|ord_trxact}}, {{vbzcart|table|ord_trx_type}}, {{vbzcart|table|ord_pkgs}} | ||
* '''History''': | |||
** '''2011-06-01''' ported from MS Access so I can print packing slips from web interface (final major piece?) | |||
==SQL== | |||
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryRpt_Pkg_Trx AS | |||
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 | WHERE WhenVoid IS NULL | ||
ORDER BY WhenDone, Amount>0; | ORDER BY WhenDone, Amount>0;</mysql> | ||
</ | <section end=sql /> |
Revision as of 23:33, 1 June 2011
About
- Requires: Template:Vbzcart, Template:Vbzcart, Template:Vbzcart
- History:
- 2011-06-01 ported from MS Access so I can print packing slips from web interface (final major piece?)
SQL
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryRpt_Pkg_Trx AS 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> <section end=sql />