Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    11

    Unanswered: convert numbers in SQL

    how can i format numbers in SQL
    Eg. i have number such as 1250.000002341 in a table [money].[Paid]
    how can i fornat that number to 125,00?

  2. #2
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    With the number stored in "money.paid", use
    Code:
    CAST(money.paid AS DECIMAL(10,2))
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    formatting is usually a function of your user interface. So its rare to come accross a requirement like this in SQL. Where are you using this information - in a report, in a screen, in a text file?
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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