Results 1 to 5 of 5

Thread: Remove decimal places

  1. #1
    Junior Member
    Join Date
    May 2008
    Answers
    4

    Remove decimal places

    I am working on microsoft OLE DB Provider for SQL Server.I am facing one of the problem for particular 1 field.

    expamle ABC=234.56

    I wanted to remove the decimal places. i want to display only
    ABC=234

    please help me out for the issues.

    Thanks in advance.

    Rohit


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Remove decimal places

    What is the logic that you want to implement ?

    Is it round off or simply truncate what ever is after decimal.


  3. #3
    Contributing Member
    Join Date
    Jun 2007
    Answers
    65

    Re: Remove decimal places

    Hi Rohit,

    You can use ROUND ( numeric_expression , length [ ,function ] ) function of SQL Server like below:
    Select Round(ABC,0)

    It will give you the rounded off value till decimal point.


    --V V--
    Vikas Vaidya


  4. #4

    Cool Re: Remove decimal places

    Quote Originally Posted by rohit_k77 View Post
    I am working on microsoft OLE DB Provider for SQL Server.I am facing one of the problem for particular 1 field.

    expamle ABC=234.56

    I wanted to remove the decimal places. i want to display only
    ABC=234

    please help me out for the issues.

    Thanks in advance.

    Rohit

    Hi Rohit

    Eg:select trunc(1234.456,0) from dual;

    This way u can remove decimals by using (TRUNC) function


  5. #5

    Cool Remove decimal places

    Hi Rohit

    Eg:select trunc(1234.456,0) from dual;
    Ans: 1234

    This way u can remove decimals by using (TRUNC) function


  6.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact