Difference between revisions of "VbzCart/queries/qryRstkReq by PurchOrd"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
m (updated name of the query this is used for)
(→‎SQL: corrected name of query in SQL)
 
Line 5: Line 5:
 
** '''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 18:55, 22 December 2008

About

  • Purpose: One of two queries which are UNIONed to create
  1. REDIRECT Template:l/vc/query
  • Requires:
  1. REDIRECT Template:l/vc/table
  • History:
    • 2008-12-22 Adapted from the discarded query qryCbxRestock_by_PurchOrd

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>