Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Posts
    16

    Unanswered: convert decimal to integer

    Hi guys
    I was wondering if you could help me.

    I have an sql which select a field that returns a floating value.

    select
    euro_amount
    from EURO_TABLE
    where customer=1;

    The floating value has 4 decimal places i.e. euro_amount = 12.0000

    I would like the euro_amount to be 12 only rather than 12.0000

    How can I convert the floating value to an Integer in SQL ?

    I would be most grateful if you could let me know.
    Thanks in advance
    Tony

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Check some of the functions here:
    http://manuals.sybase.com/onlinebook...364;pt=34826#X

    ROUND or FLOOR sounds like you best bet, followed by a CONVERT to INT (if you *really* need the datatype to be an int).
    Thanks,

    Matt

Posting Permissions

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