VbzCart/docs/queries/qryRstkReq by status: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (New page: ==About== * '''Purpose''': One of two queries which are UNIONed to create {{vbzcart/query|qryRstkReq}} * '''Requires''': {{vbzcart/table|rstk_req}}, {{vbzcart/table|cat_supp}...) |
m (Woozle moved page VbzCart/VbzCart/queries/qryRstkReq by status to VbzCart/docs/queries/qryRstkReq by status without leaving a redirect: part 3/5) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
==About== | ==About== | ||
* '''Purpose''': One of two queries which are [[SQL/UNION|UNION]]ed to create {{vbzcart/query| | * '''Purpose''': One of two queries which are [[SQL/UNION|UNION]]ed to create {{vbzcart/query|qryCbx_RstkReq}} | ||
* '''Requires''': {{vbzcart/table|rstk_req}}, {{vbzcart/table|cat_supp}} | * '''Requires''': {{vbzcart/table|rstk_req}}, {{vbzcart/table|cat_supp}} | ||
* '''History''': | * '''History''': |
Latest revision as of 01:56, 25 February 2024
About
- Purpose: One of two queries which are UNIONed to create Template:Vbzcart/query
- Requires: Template:Vbzcart/table, Template:Vbzcart/table
- History:
- 2008-12-22 Adapted from the discarded query qryCbxRestock_by_status
SQL
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryRstkReq_by_status AS SELECT
r.ID, CAST( CONCAT( CAST(COALESCE( CONCAT('X ',DATE_FORMAT(r.WhenKilled,'%Y-%m-%d')), CONCAT('O ',DATE_FORMAT(r.WhenOrdered,'%Y-%m-%d')), CONCAT('C ',DATE_FORMAT(r.WhenCreated,'%Y-%m-%d')) ) AS BINARY), ' ', s.CatKey, IFNULL(CONCAT(' [',r.PurchOrdNum,']'),) ) AS CHAR ) AS Descr, NOT IsLocked AS IsOpen, r.WhenOrdered, r.WhenConfirmed, r.ID_Supplier
FROM rstk_req AS r LEFT JOIN cat_supp AS s ON r.ID_Supplier=s.ID ORDER BY COALESCE(r.WhenKilled,r.WhenOrdered,r.WhenCreated) DESC;</mysql> <section end=sql />