A query a seguir está travando pra mim, é um problema da query ou é alguma coisa do banco?
SELECT MAX(FK1_DATA) ULTBAIXA
FROM FKA010 FKA
INNER JOIN FK1010 FK1 ON
FKA.FKA_FILIAL = FK1.FK1_FILIAL
AND FKA.FKA_IDORIG = FK1.FK1_IDFK1
AND FKA.FKA_TABORI = 'FK1'
AND FK1.FK1_IDDOC = '9bd411fc6aee400090C0e56881a2eada'
AND FK1.FK1_MOTBX <> 'CMP'
AND FK1.D_E_L_E_T_ = ' '
WHERE
FKA.FKA_IDPROC NOT IN (
SELECT DISTINCT FKA.FKA_IDPROC
FROM FKA010 FKA
INNER JOIN FK1010 FK1 ON
FKA.FKA_IDORIG = FK1.FK1_IDFK1
AND FKA.FKA_TABORI = 'FK1'
AND FK1.FK1_IDDOC = '9bd411fc6aee400090C0e56881a2eada'
AND FK1.FK1_TPDOC = 'ES'
AND FK1.D_E_L_E_T_ = ' '
WHERE FKA.D_E_L_E_T_ = ' ' )
AND FKA.D_E_L_E_T_ = ' '