VbzCart/docs/queries/qryRstkReq by PurchOrd

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Jump to navigation Jump to search

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>