VbzCart/docs/queries/discarded/qryCbx Restocks byPurchOrd

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries‎ | discarded
Revision as of 01:55, 25 February 2024 by Woozle (talk | contribs) (Woozle moved page VbzCart/VbzCart/queries/discarded/qryCbx Restocks byPurchOrd to VbzCart/docs/queries/discarded/qryCbx Restocks byPurchOrd without leaving a redirect: part 2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Details

SQL

<mysql>CREATE OR REPLACE VIEW qryCbx_Restocks_byPurchOrd AS SELECT

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

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