SQL Trunating Decimal

Posted on 2005-04-25
Last Modified: 2006-11-18
Hopefully this is an easy question but i am new to sql and having problems

What i want to do is calculate a LTV this returns me a percenatage for example

95.25 what i would like to do is truncate any decimal places but do not round up.

so 95.75 would be 95
Question by:Steege
    LVL 28

    Accepted Solution

    Try this one:

    SELECT ROUND(95.75, 0, 1)
    LVL 28

    Expert Comment

    In the ROUND function, the second parameter is the number of decimal places you want in the output while any non-zero numeric value in the third parameter means you want the result truncated.
    LVL 17

    Expert Comment

    you can actually get away with just casting as an integer, since by defualy, floats are truncated, not rounded,
    select cast(95.75 as integer)

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now