Question regarding decimal field

  • Dear All

    I have a question regarding decimal field, i have set field to DECIMAL (18,2) and it looks like this, is there a way to separate thousands with dot(.), so that number looks like 9.090,00 in column. It is a pretty big table and when i got the results after SUM i get unclear numbers, like 2012328239.00

    Thanks

    Kind regards,

    Capture1

  • Don't mess with the formatting in the data storage. Let it store the raw number as is, decimal (18,2) as you defined. Then, format the results in the client or report or whatever. This is the right way to deal with data. Raw data in the database, formatted data outside the database.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Hej Grant,

    Thank you for the confirmation, i appreciate it. This is very important for me to know the principle is right for further assignement.

    I guessed that's the right format for SQL data storage column, and the formatting is on client's side, but was not for sure..

    Thanks man 🙂

  • Not a problem. Happy to help.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply