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.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- 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
|
||||
Reference in New Issue
Block a user