title: SQL join with concat and substring
body: <p>So I'm attempting to do a join that requires both CONCAT and SUBSTRING.</p>
  <p>Table one has a column with a date and location e.g. '02:00 IND'</p>
  <p>Table two has a column with date/time e.g. '2020-10-10 02:00:00.000000' and another column with location e.g. 'IND'.</p>
  <p>This is the statement that I'm trying but it isn't working:</p>
  <pre><code>       SELECT * 
         FROM FIRST_TABLE
         INNER JOIN SECOND_TABLE on FIRST_TABLE.TIME_LOCATION = 
         CONCAT(SUBSTRING(SECOND_TABLE.TIME,12,5) , SECOND_TABLE.LOCATION); 
  </code></pre>
  <p>I am receiving the below error:</p>
  <blockquote>
  <p>[SQL0171] Argument 1 of function
  SUBSTRING not valid. Cause . . . . . : The data type, length, or value
  of argument 1 of function SUBSTRING specified is not valid. Recovery .
  . . : Refer to the DB2 for IBM i SQL Reference topic collection in the
  Database category in the IBM i Information Center for more information
  on scalar functions. Correct the arguments specified for the function.
  Try the request again</p>
  </blockquote>