In a new project i have the following which i cant get to compare properly
SELECT [D 01 RM FR Reason Code Update].*, Left([Customer_Action_Req_d_Reason],InStr(1,[Customer_Action_Req_d_Reason],",")-1) AS Code1, Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")+2,InStr(Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")),",")+2) AS Code2, Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")+5,InStr(Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")),",")+2) AS Code3
FROM [D 01 RM FR Reason Code Update];
What this does is seperates values from a field into 3 new columns.
Code1 Code2 Code3
What i want to do is, 1 compare it to a table to validate the code.
Example
Code1 = 089 I have a table which 089 is a code.
Codes are contained in
Fee Reversal Transaction Codes.Trans_Code
Right now im using the Like criteria, This works for the time being,
But what i really want to do is.
If the code is NOT in the table, Or is not in the like then i want to assign a code as 999
If i need to explain this better, i certainly can try
i appreciate the time someone reads and commends on this
SELECT [D 01 RM FR Reason Code Update].*, Left([Customer_Action_Req_d_Reason],InStr(1,[Customer_Action_Req_d_Reason],",")-1) AS Code1, Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")+2,InStr(Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")),",")+2) AS Code2, Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")+5,InStr(Mid([Customer_Action_Req_d_Reason],InStr([Customer_Action_Req_d_Reason],",")),",")+2) AS Code3
FROM [D 01 RM FR Reason Code Update];
What this does is seperates values from a field into 3 new columns.
Code1 Code2 Code3
What i want to do is, 1 compare it to a table to validate the code.
Example
Code1 = 089 I have a table which 089 is a code.
Codes are contained in
Fee Reversal Transaction Codes.Trans_Code
Right now im using the Like criteria, This works for the time being,
But what i really want to do is.
If the code is NOT in the table, Or is not in the like then i want to assign a code as 999
If i need to explain this better, i certainly can try
