LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only

DB Query, SELECT & substr()?

  • 1.  DB Query, SELECT & substr()?

    Employee
    Posted 06-29-2017 12:02

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Brad Brezinski

    I 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