top of page

WHERE Clauses Part 2: A Few Useful SQL Queries (free)

As promised, I’m giving you a few SQL queries that I find to be particularly helpful to my clients. Feel free to open the files by clicking on the links, then copy/paste them into your WHERE clauses for the corresponding locations.


Note that your particular scenario might require some addition tweaking. For example, I haven't included any site filters, which could be important if you're part of a multi-site Maximo implementation.


Inventory Requiring Reorder (us in the Inventory application)


This will show all inventory items that are at or below the reorder point. It adjusts for any open PRs and POs, and also any WO reservations, using the same calculation that Maximo uses for the actual reorder.



Work Orders Assigned to the Current Logged-in User (use in the Work Order Tracking application)


This query will return all work orders where the current, logged-in user is part of the work group assigned to the work order. Keep in mind that each plant has their own way of determining who is assigned to a work order. You're plant might use the Lead or Supervisor field, or prefer to organize using assignments.


IMPORTANT NOTE: This clause uses a variable to allow the same query to be used by different users, but so that it displays different data depending on which user is logged in. When you save it for the first time, however, Maximo will annoyingly replace the variable with your own, hard-coded person ID. So when the next user logs in, they’ll see your work orders, not theirs. To fix this, you’ll need to perform another step after saving the query. Open the ‘View/Manage Queries’ dialog from the ‘Save Query’ drop-down menu. Find your query and expand it. Locate the following line of code, and replace it as follows, assuming your person ID is JSMITH. By doing this, you'll restore the SQL back to the original version that you copied in the first place.


Replace:

AND ‘JSMITH’ IN

with:

AND :&PERSONID& IN



Locations with Active Work (use in the Locations application)


My clause doesn’t include completed work orders, but you could probably figure out how to change this yourself by studying the SQL and tweaking it.



Top 30% of Inventory, Ranked by Value and Consumption Rate (1Y) (us in the Inventory application)


This is based on the concept of inventory ABC Analysis, and it could easily be expanded to include the whole methodology of ABC analysis.




210 views0 comments

Recent Posts

See All

留言


bottom of page