I need to convert the below SQL statement into Regular Expression.
CASE WHEN TypeCode >= 400
AND TypeCode < 700
THEN Amt * -1
ELSE Amt
END
Background: I am putting a bank transactions file (BAI2 file) in to a system for transactional matching (matching bank transactions to GL transactions). In order to get these transactions to match, the fields to match on have to be exactly the same. However, in the GL a $500
check may be input as -500
(because the company's cash account is being reduced by $500
for a utility bill), but BAI
files store all amounts as positive values. I need to use the transaction type code from the bank to identify whether an amount should be a debit or a credit (in reference to the GL).
I have SQL developers that can do this using SQL, but this tool I'm using to do the BAI
data manipulation requires the logic to be input as Regular Expression.
Can anyone assist in applying the appropriate signage (positive or negative) to these amounts for bank transactions? Can this even be done? I'm a new poster so please bear with any ignorance and let me know if I can provide further details/information.