DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: to_char(number)

  1. #1
    Join Date
    May 2002
    Posts
    35
    Hi, all, I am using the to_char function as following:

    SELECT TO_CHAR(SUM(N_SHIPPED_QTY*N_TMSS_UNIT_BYG_PRC),'9G999D99') FROM TT_INVC_DET;

    I don't understand why the return result is #######. Is
    it because of my SQL+ setting?

  2. #2
    Join Date
    Apr 2002
    Location
    Shenzhen, China
    Posts
    327
    You probably have to modify your NUMBER FORMAT MODEL to increase enough number of digits to display the result.

    like '999G999G999D99'
    Oracle Certified Master - September, 2003, the Second OCM in China
    *** LOOKING for PART TIME JOB***
    Data Warehouse & Business Intelligence Expert
    MCSE, CCNA, SCJP, SCSA from 1998

  3. #3
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    Do you have any coluimn length set for this column?
    Try "clear columns" before running the query.

    Sanjay

  4. #4
    Join Date
    Aug 2000
    Location
    Shanghai
    Posts
    433
    D 99D99 decimal character
    G 9G99 group separator

    (from RevealNet)

    TRY

    SELECT TO_CHAR(SUM(N_SHIPPED_QTY*N_TMSS_UNIT_BYG_PRC),'99999G999D99') FROM TT_INVC_DET


    BECAUSE IN YOUR DATABASE , THE
    N_SHIPPED_QTY*N_TMSS_UNIT_BYG_PRC

    AMOUNT IS BIGGER THAN 9999 , SO IT'S NOT DISPLAYED PROPERLY
    1. www.dbasupport.com
    2. www.dbforums.com
    3. www.itpub.net
    4. www.csdn.net
    5. www.umlchina.com
    6. www.tek-tips.com
    7. www.cnforyou.com
    8. fm365.federal.com.cn
    9. www.programmersheaven.com
    10.http://msdn.microsoft.com/library/default.asp
    ligang1000@hotmail.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width