Thank you gentlemen. I was able to get the following to work:
INNER JOIN TABLE B ON CAST((SUBSTR('00000000000000000000',1,20-CHARS(TRIM(A.ACCT_NB)))||A.ACCT_NB) AS CHAR(50)) = B.ACCT_NUM
Perhaps the Trim wasn't necessary and maybe I didn't need to Cast to Char(50) for this Join? Not sure, but using the Substring to get the leading zeros solved the problem.
Seems like the example presented above of Trim(Leading '0' from Cast(... would have been a bit easier though. Wish I had seen this prior to coming up with the Substr method. Will have to remember that in the future. Thanks again!
Thank you gentlemen. I was able to get the following to work:
INNER JOIN TABLE B ON CAST((SUBSTR('00000000000000000000',1,20-CHARS(TRIM(A.ACCT_NB)))||A.ACCT_NB) AS CHAR(50)) = B.ACCT_NUM
Perhaps the Trim wasn't necessary and maybe I didn't need to Cast to Char(50) for this Join? Not sure, but using the Substring to get the leading zeros solved the problem.
Seems like the example presented above of Trim(Leading '0' from Cast(... would have been a bit easier though. Wish I had seen this prior to coming up with the Substr method. Will have to remember that in the future. Thanks again!