title: Converting SQL statement to Regular Expression - can it be done?
body: <p>I need to convert the below SQL statement into Regular Expression. </p>
  
  <pre><code>CASE WHEN TypeCode &gt;= 400 
        AND TypeCode &lt; 700 
       THEN Amt * -1 
       ELSE Amt 
   END
  </code></pre>
  
  <p>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 <code>$500</code> check may be input as <code>-500</code> (because the company's cash account is being reduced by <code>$500</code> for a utility bill), but <code>BAI</code> 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). </p>
  
  <p>I have SQL developers that can do this using SQL, but this tool I'm using to do the <code>BAI</code> data manipulation requires the logic to be input as Regular Expression. </p>
  
  <p>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.</p>