Here is a challenging one for you guys, thank you in advance. The end goal of the below expression is to determine if a unit has passed or failed a repair process....Here is the original request from my colleague and below is what I have so far:
• Where there is a U anywhere in the Repair Code = FAIL
o Access Repair Code calculation = Like “*U*”
• Where there is an R anywhere in the Repair Code AND the Repair Comments field is NOT NULL = FAIL
o Access Repair Code calculation = Like “*R*”
o Access Repair Comments calculation = Is Not Null
• Where there is an N anywhere in the Repair Code = PASS
o Access Repair Code calculation = Like “*N*”
• Where there is an R anywhere in the Repair Code field AND the Repair Comments field is NULL = PASS
o Access Repair Code calculation = Like “*R*”
o Access Repair Comments calculation = Is Null
• Any code that does NOT contain a U, N or R anywhere in the Repair Code = PASS
o Access Repair Code = Not Like “*U*” and Not Like “*R*” and Not Like “*N*”
--------------------------------
My expression so far:
FAIL / PASS RESULT: IIf([REP_CODE]="*u*" Or [REP_CODE]="*r*" And [REPAIR_COMMENTS]=Not IsNull([REPAIR_COMMENTS]),"FAILURE",IIf([REP_CODE]="*n*" Or [REP_CODE]="*r*" And [REPAIR_COMMENTS]=IsNull([REPAIR_COMMENTS]) Or [REP_CODE]<>"u" Or [REP_CODE]<>"n" Or [REP_CODE]<>"r","PASS",""))
I think my issue lies withing the [field] = Not IsNull....
• Where there is a U anywhere in the Repair Code = FAIL
o Access Repair Code calculation = Like “*U*”
• Where there is an R anywhere in the Repair Code AND the Repair Comments field is NOT NULL = FAIL
o Access Repair Code calculation = Like “*R*”
o Access Repair Comments calculation = Is Not Null
• Where there is an N anywhere in the Repair Code = PASS
o Access Repair Code calculation = Like “*N*”
• Where there is an R anywhere in the Repair Code field AND the Repair Comments field is NULL = PASS
o Access Repair Code calculation = Like “*R*”
o Access Repair Comments calculation = Is Null
• Any code that does NOT contain a U, N or R anywhere in the Repair Code = PASS
o Access Repair Code = Not Like “*U*” and Not Like “*R*” and Not Like “*N*”
--------------------------------
My expression so far:
FAIL / PASS RESULT: IIf([REP_CODE]="*u*" Or [REP_CODE]="*r*" And [REPAIR_COMMENTS]=Not IsNull([REPAIR_COMMENTS]),"FAILURE",IIf([REP_CODE]="*n*" Or [REP_CODE]="*r*" And [REPAIR_COMMENTS]=IsNull([REPAIR_COMMENTS]) Or [REP_CODE]<>"u" Or [REP_CODE]<>"n" Or [REP_CODE]<>"r","PASS",""))
I think my issue lies withing the [field] = Not IsNull....