diff --git a/helpers/lotOccupancyDB/getWorkOrders.js b/helpers/lotOccupancyDB/getWorkOrders.js index d88253b6..f907419b 100644 --- a/helpers/lotOccupancyDB/getWorkOrders.js +++ b/helpers/lotOccupancyDB/getWorkOrders.js @@ -42,7 +42,7 @@ export const getWorkOrders = (filters, options) => { for (const lotNamePiece of lotNamePieces) { sqlWhereClause += " and w.workOrderId in (" + - "select workOrderId from WorkOrderLots where recordDelete_timeMillis is null and lotId in (select lotId from Lots oo where recordDelete_timeMillis is null and instr(lower(lotName), ?)))"; + "select workOrderId from WorkOrderLots where recordDelete_timeMillis is null and lotId in (select lotId from Lots where recordDelete_timeMillis is null and instr(lower(lotName), ?)))"; sqlParameters.push(lotNamePiece); } } diff --git a/helpers/lotOccupancyDB/getWorkOrders.ts b/helpers/lotOccupancyDB/getWorkOrders.ts index 82cc6a4b..a47f96a6 100644 --- a/helpers/lotOccupancyDB/getWorkOrders.ts +++ b/helpers/lotOccupancyDB/getWorkOrders.ts @@ -79,7 +79,7 @@ export const getWorkOrders = ( for (const lotNamePiece of lotNamePieces) { sqlWhereClause += " and w.workOrderId in (" + - "select workOrderId from WorkOrderLots where recordDelete_timeMillis is null and lotId in (select lotId from Lots oo where recordDelete_timeMillis is null and instr(lower(lotName), ?)))"; + "select workOrderId from WorkOrderLots where recordDelete_timeMillis is null and lotId in (select lotId from Lots where recordDelete_timeMillis is null and instr(lower(lotName), ?)))"; sqlParameters.push(lotNamePiece); } }