-1

I am trying to run a query in Maximo work order tracking to find PM work orders that are not COMP, CLOSE, COMPFLD, or CAN where the PM.EXTDATE is not NULL. Here is what I have but it does not work.

((wosequence is null and status not in ('COMP', 'COMPFLD') and (woclass = 'WORKORDER' or woclass = 'ACTIVITY') and upper(crewid) = 'SD' and historyflag = 0 and istask = 0 and siteid = 'SD' and pmnum like '%') and (exists (select from MAXIMO_PM where ((MAXIMO_WORKORDER.PMNUM = MAXIMO_PM.PMNUM) and (MAXIMO_PM.EXTDATE Like '%')))))

1 Answers1

1

The table names are PM and WORKORDER. Leave off the MAXIMO_ bit.

Also, you need to select something in your PM subquery. Change select from PM to select 1 from PM.

Preacher
  • 2,127
  • 1
  • 11
  • 25
  • Thanks, I also needed to add a 1 after (select. (select 1 – user19718251 Aug 09 '22 at 10:38
  • I have incorporated your comments into my answer. I see you are new here. Welcome! If my answer helped you, you should accept it. You can also up-vote it if you think it was high quality. – Preacher Aug 09 '22 at 16:35