ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

in wrkqry translate -1 to '負' .....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • in wrkqry translate -1 to '負' .....

    hi ,dear

    In wrkqry ,which methods can translate -1 to '負' and translate +1 to '正' ?

    thanks.

  • #2
    Re: in wrkqry translate -1 to '負' .....

    we cant see this character '負' can you post an image please use this tool

    thanks

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: in wrkqry translate -1 to '負' .....

      hi ,jamie.

      if the value of this field is -1,i want to use character 'y' to describe '-1' and display it('y') in my qry.any ideas?


      thanks .

      Comment


      • #4
        Re: in wrkqry translate -1 to '負' .....

        I cant think of a way to do that in query, it would be rather eeasy in RPG. But
        I am far from an expert in query.....

        any ideas out there maybe using two queries and result fields somehow?

        jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: in wrkqry translate -1 to '負' .....

          The ONLY way I know you can do this is by splitting it up into separate Queries.

          Qry 1:
          Define a Result field (Char_Y as 'Y')
          Select all records where Field = -1
          Select output to QTemp/Qry1

          Qry 2:
          Define a Result field (Char_Z as 'Z')
          Select all records where Field = +1
          Select output to QTemp/Qry2

          Qry 3:
          Join Qry1 and Qry2
          (include selects/sorts, etc)
          Select output to QTemp/Qry3

          Qry3 should then contain your desired output

          hth

          Comment

          Working...
          X