VbzCart/docs/queries/qryRstkReq by PurchOrd: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
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}} * '''History''': ** '''200...)
 
m (Woozle moved page VbzCart/VbzCart/queries/qryRstkReq by PurchOrd to VbzCart/docs/queries/qryRstkReq by PurchOrd without leaving a redirect: part 3/5)
 
(2 intermediate revisions 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|qryRstkReq}}
* '''Purpose''': One of two queries which are [[SQL/UNION|UNION]]ed to create {{vbzcart/query|qryCbx_RstkReq}}
* '''Requires''': {{vbzcart/table|rstk_req}}
* '''Requires''': {{vbzcart/table|rstk_req}}
* '''History''':
* '''History''':
** '''2008-12-22''' Adapted from the [[../discarded|discarded]] query qryCbxRestock_by_PurchOrd
** '''2008-12-22''' Adapted from the [[../discarded|discarded]] query qryCbxRestock_by_PurchOrd
==SQL==
==SQL==
<mysql>CREATE OR REPLACE VIEW qryCbx_RstkReq_by_PurchOrd AS
<mysql>CREATE OR REPLACE VIEW qryRstkReq_by_PurchOrd AS
SELECT
SELECT
   r.ID,
   r.ID,

Latest revision as of 01:56, 25 February 2024

About

SQL

<mysql>CREATE OR REPLACE VIEW qryRstkReq_by_PurchOrd AS SELECT

 r.ID,
 CAST(r.PurchOrdNum AS CHAR) AS Descr,
 NOT IsLocked AS IsOpen,
 r.WhenOrdered,
 r.WhenConfirmed,
 r.ID_Supplier

FROM rstk_req AS r WHERE r.PurchOrdNum IS NOT NULL ORDER BY COALESCE(r.WhenKilled,r.WhenOrdered,r.WhenCreated) DESC;</mysql>