6 Replies Latest reply: Nov 7, 2017 7:20 AM by Maxime Golinvaux RSS

    Problem with "right" function in script

    Maxime Golinvaux

      Hello, i'm facing a strange bug with the "right" function in my script.


      I wan't to get the last five characters in a string with letters and numbers (XX00000000 or more numbers) ,so i use this:



      num(right(MYFIELD,5),'00000') as Field


      The problem is when the string contain some "0", the function not works properly. The function get only characters before the "0", example:


      DE60831584 -> 31584 -> correct

      DE24708585 -> 8585 instead of 08585

      DE0344700003 -> 0003 instead of 00003


      It seems the function delete a "0" in the position 5.


      When i'm using the function in a text box, that works perfectly (see attachment), i don't understand why this is not working in script.


      We using QV 11.20 SR15.


      Thank you for your help.