How to concatenate 3 fields in a where statement see attach

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • J Mason
    New Member
    • Sep 2010
    • 2

    #1

    How to concatenate 3 fields in a where statement see attach

    SELECT concatenate(por t_npa,port_nxx, port_line)as account
    FROM DBxx.blah.TLRNC URR
    WHERE account = 1234567891

    OR

    SELECT *
    FROM DBxx.blah.TLRNC URR
    WHERE concatenate (port_npa,port_ nxx,port_line)= 1234567891

    Either way it doesn't work, I'm using QMF v.8
  • yarbrough40
    Contributor
    • Jun 2009
    • 320

    #2
    This is just a guess... have you tryed

    WHERE port_npa + port_nxx + port_line = '1234567891'

    Comment

    • J Mason
      New Member
      • Sep 2010
      • 2

      #3
      I tried it, it ran for an inordinate amount of time and returned the wrong answer.

      Comment

      • yarbrough40
        Contributor
        • Jun 2009
        • 320

        #4
        Interesting.. are the column types integers? Perhaps it is doing some kind of complex math when all you want is a concatenation. maybe u could use db2's function to convert the values to text. (not sure what that is. In sql server it is cast as varchar). That might do the trick

        Comment

        Working...