Maximo Open Forum

 View Only
  • 1.  SQL Query Help

    Posted 03-19-2024 14:08

    Hello All, 

    I'm looking for a little bit of help creating a query in Maximo. My SQL is a little rusty and I can't quite figure out how to query what I want. I am trying to find all closed work orders where the status date is greater than X amount of days past the reported date. We would like to see how many "backlogged" WOs we have had, and we are going to classify "backlogged" as any work order where it took more than ~60 days to close. I know this won't be perfect, but it will get us something to work with. I will hopefully be improving the data entry/tracking moving forward.

    For example, find all closed WOs where the status date(in theory the date they were closed) is more than 60 days past the date they were reported. 

    Also, if anyone else had a different approach to this problem please feel free to share. 

    Thanks!


    #Administration
    #Reporting
    #WorkManagement

    ------------------------------
    Brett Hawkins
    ------------------------------


  • 2.  RE: SQL Query Help

    Posted 03-19-2024 14:41

    Hi Brett, try this:  select wonum, description, round(changedate-reportdate,1) as days from maximo.workorder where status = 'CLOSE' and istask = 0

    and changedate - reportdate > 60;



    ------------------------------
    Mark Fresa
    ------------------------------



  • 3.  RE: SQL Query Help

    Posted 03-19-2024 16:48

    Thanks a ton for the help! 

    I ended up getting it to work going down a slightly different route. I added, statusdate >= (dateadd(month, 2, reportdate)) to my where clause and it seemed to pull the correct data.



    ------------------------------
    Brett Hawkins
    ------------------------------



  • 4.  RE: SQL Query Help

    Posted 03-19-2024 14:45

    Brett, the query I sent assumes you only went to CLOSE status once on a given work order.  If you enable users to take it out of CLOSE for any reason, and the go back to CLOSE at some future date, the query gets a bit more complicated.



    ------------------------------
    Mark Fresa
    ------------------------------



  • 5.  RE: SQL Query Help

    Posted 03-19-2024 22:13

    Hi Brett!

    select wonum, status, statusdate, reportdate from maximo.workorder where status = 'CLOSE' and DAYS(statusdate) - DAYS(reportdate) > 60

    Regards!



    ------------------------------
    Martin Fabra
    ARSAT S.A.
    ------------------------------