Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Brad BrezinskiI need to do an inner join on account numbers. One table has them trimmed to 13 characters (everything after that character is only 0's...) the other doesn't (ie. 1234567891234000000/1234567891234). How do I trim the longer int so and can join the tables? The example below isn't working:
Select
a.MSTR_ACCT_NB
,a.substr(PARNT_ACCT_ID,0,12)
,asub.vInvoiceNo2
From database.table a
INNER JOIN
database2.table2 b
on b.vInvoiceNo2 = a.PARNT_ACCT_ID
Thanks, Brad