I need a report that would show where a REACTIVE workorder (RD) have been generated 15 days or less after a PREVENTIVE MAINTENANCE workorder (PM).
These are all in one table called WORKORDER, but the WORKTYPE would be either PM or RD.
I would also like to group them by ASSETNUM and Sort by REPORTDATE asc.
The results would show like:
WONUM DESC WORKTYPE REPORTDATE
101 Lube bearings PM 1/1/10
102 Bearing making noises RD 1/9/10
I want to suppress single PM's that don't have an RD within 15 days of it.
I want to suppress single RD's that don't have a PM 15 days prior to it.
Here is what I have so far. but can't figure out how to nest the worktype and actual finish date?
Here is what I tried in the select expert({WORKORDER.WORKTYPE} ="PM" and {WORKORDER.ACTFINISH} < {WORKORDER.WORKTYPE} ="RD" and {WORKORDER.ACTFINISH}+15)
The rest of this kinda works if I could suppress like I stated earlier.
Select Expert:
(Not(isNull({WORKORDER.ASSETNUM}))) and
({WORKORDER.ACTFINISH} < {WORKORDER.ACTFINISH}+15) and
{WORKORDER.ISTASK} = 0.00 and
{WORKORDER.HISTORYFLAG} = 1.00 and
{WORKORDER.WORKTYPE} in ["PM", "RD"] and
{WORKORDER.WOEQ9} like "LGB*"
SQL:
SELECT "WORKORDER"."STATUS", "WORKORDER"."WONUM", "WORKORDER"."WORKTYPE", "WORKORDER"."LOCATION", "WORKORDER"."ESTLABHRS", "WORKORDER"."ACTLABHRS", "WORKORDER"."TARGCOMPDATE", "WORKORDER"."REPORTDATE", "WORKORDER"."HISTORYFLAG", "WORKORDER"."ISTASK", "WORKORDER"."DESCRIPTION", "PERSON"."DISPLAYNAME", "WORKORDER"."ACTFINISH", "WORKORDER"."ASSETNUM", "WORKORDER"."WOEQ9"
FROM "MAXIMO"."WORKORDER" "WORKORDER", "MAXIMO"."PERSON" "PERSON"
WHERE ("WORKORDER"."LEAD"="PERSON"."PERSONID" (+)) AND "WORKORDER"."WOEQ9" LIKE 'LGB%' AND "WORKORDER"."ASSETNUM" IS NOT NULL AND "WORKORDER"."ISTASK"=0 AND "WORKORDER"."HISTORYFLAG"=1 AND ("WORKORDER"."WORKTYPE"='PM' OR "WORKORDER"."WORKTYPE"='RD')
ORDER BY "WORKORDER"."ASSETNUM", "WORKORDER"."TARGCOMPDATE"
These are all in one table called WORKORDER, but the WORKTYPE would be either PM or RD.
I would also like to group them by ASSETNUM and Sort by REPORTDATE asc.
The results would show like:
WONUM DESC WORKTYPE REPORTDATE
101 Lube bearings PM 1/1/10
102 Bearing making noises RD 1/9/10
I want to suppress single PM's that don't have an RD within 15 days of it.
I want to suppress single RD's that don't have a PM 15 days prior to it.
Here is what I have so far. but can't figure out how to nest the worktype and actual finish date?
Here is what I tried in the select expert({WORKORDER.WORKTYPE} ="PM" and {WORKORDER.ACTFINISH} < {WORKORDER.WORKTYPE} ="RD" and {WORKORDER.ACTFINISH}+15)
The rest of this kinda works if I could suppress like I stated earlier.
Select Expert:
(Not(isNull({WORKORDER.ASSETNUM}))) and
({WORKORDER.ACTFINISH} < {WORKORDER.ACTFINISH}+15) and
{WORKORDER.ISTASK} = 0.00 and
{WORKORDER.HISTORYFLAG} = 1.00 and
{WORKORDER.WORKTYPE} in ["PM", "RD"] and
{WORKORDER.WOEQ9} like "LGB*"
SQL:
SELECT "WORKORDER"."STATUS", "WORKORDER"."WONUM", "WORKORDER"."WORKTYPE", "WORKORDER"."LOCATION", "WORKORDER"."ESTLABHRS", "WORKORDER"."ACTLABHRS", "WORKORDER"."TARGCOMPDATE", "WORKORDER"."REPORTDATE", "WORKORDER"."HISTORYFLAG", "WORKORDER"."ISTASK", "WORKORDER"."DESCRIPTION", "PERSON"."DISPLAYNAME", "WORKORDER"."ACTFINISH", "WORKORDER"."ASSETNUM", "WORKORDER"."WOEQ9"
FROM "MAXIMO"."WORKORDER" "WORKORDER", "MAXIMO"."PERSON" "PERSON"
WHERE ("WORKORDER"."LEAD"="PERSON"."PERSONID" (+)) AND "WORKORDER"."WOEQ9" LIKE 'LGB%' AND "WORKORDER"."ASSETNUM" IS NOT NULL AND "WORKORDER"."ISTASK"=0 AND "WORKORDER"."HISTORYFLAG"=1 AND ("WORKORDER"."WORKTYPE"='PM' OR "WORKORDER"."WORKTYPE"='RD')
ORDER BY "WORKORDER"."ASSETNUM", "WORKORDER"."TARGCOMPDATE"