Files
jdescopingtool/DATA_SYNC/JDE_ARCHIVE/SQL_GET_WORKORDER_TIMES.sql
T
Joseph Doherty d4135e8ad3 fix(data-access): correct self-referential SQL in WorkCenter filter
The WHERE clause was comparing Code to itself instead of the aliased
table reference, which would always be true.
2026-01-06 14:12:07 -05:00

27 lines
850 B
SQL

-- WorkOrderTime Archive Query
-- Source: QADTA.F31122 (current) + ARCDTAQA.F31122 (archived)
-- Used by: GetWorkOrderTimesArchive() - on-demand historical retrieval
-- Note: Not scheduled, used for historical lookups
SELECT wot.WTUKID AS UniqueID,
TRIM(wot.WTMMCU) AS BranchCode,
wot.WTDOCO AS WorkOrderNumber,
wot.WTOPSQ AS StepNumber,
wot.WTAN8 AS AddressNumber,
wot.WTDGL AS GlDate,
wot.WTUPMJ AS DateUpdated,
wot.WTTDAY AS TimeUpdated
FROM QADTA.F31122 wot
UNION ALL
SELECT wot.WTUKID AS UniqueID,
TRIM(wot.WTMMCU) AS BranchCode,
wot.WTDOCO AS WorkOrderNumber,
wot.WTOPSQ AS StepNumber,
wot.WTAN8 AS AddressNumber,
wot.WTDGL AS GlDate,
wot.WTUPMJ AS DateUpdated,
wot.WTTDAY AS TimeUpdated
FROM ARCDTAQA.F31122 wot