Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    In SQL: how to make decimal point appear before last two digits

    • Article Type: General
    • Product: Aleph
    • Product Version: 20

    Description:
    How can we make a sum get the decimal point before the last two digits in an sql

    When we do this:

    usm50@ALEPH201> select z31_sum from z31;
    **** Hit return to continue ****

    Z31_SUM
    --------------
    00000000007500


    How can we set the result to appear like this:
    000000000075.00

    instead of

    00000000007500

    Resolution:
    SQL> select to_char(z31_sum, '9999D99') from usm50.z31;

    The number of 9's indicates the number of maximum number of digits being displayed.


    • Article last edited: 10/8/2013