Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

How to round up?

Discussion in 'Information Technology' started by Beatrix, Nov 3, 2005.

Tags:
  1. Beatrix

    Beatrix
    Expand Collapse
    Guest

    Hello!

    My task is to round all up:
    2.1=3
    2.2=3
    ....
    2.9=3
    Is it possible to do in a query?
    Thank you!
     
  2. Loading...

    Similar Threads Forum Date
    UK Turban Kicked off His Head & Beaten to the Ground, Sikh Lawyer's Day in Court Begins Breaking News Jan 23, 2014
    General Teenager Admits She Punched Sikh Pensioner, 80, To The Ground Hard Talk Oct 19, 2013
    Movies Ashdoc's half complete movie review---Frozen ground Theatre, Movies & Cinema Sep 7, 2013
    SciTech B-School Startup: Turning Coffee Grounds Into Food Breaking News Sep 2, 2013
    Canada The Money Merry-Go-Round Breaking News Jul 10, 2013

  3. Dennis

    Dennis
    Expand Collapse
    Guest

    Use the Int function like this

    Int([YourNumber] + .99)

    "Beatrix" wrote:

    > Hello!
    >
    > My task is to round all up:
    > 2.1=3
    > 2.2=3
    > ...
    > 2.9=3
    > Is it possible to do in a query?
    > Thank you!
     
  4. Ofer

    Ofer
    Expand Collapse
    Guest

    Try this

    Select Round(FieldName + 0.5) As NewRoundUp From TableName
    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "Beatrix" wrote:

    > Hello!
    >
    > My task is to round all up:
    > 2.1=3
    > 2.2=3
    > ...
    > 2.9=3
    > Is it possible to do in a query?
    > Thank you!
     
  5. Dennis

    Dennis
    Expand Collapse
    Guest

    That works if the Fieldname has a decimal but does not work for whole numbers.
    2.1 will round to 3 but 2.0 will also round to 3

    "Ofer" wrote:

    > Try this
    >
    > Select Round(FieldName + 0.5) As NewRoundUp From TableName
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "Beatrix" wrote:
    >
    > > Hello!
    > >
    > > My task is to round all up:
    > > 2.1=3
    > > 2.2=3
    > > ...
    > > 2.9=3
    > > Is it possible to do in a query?
    > > Thank you!
     
  6. Ofer

    Ofer
    Expand Collapse
    Guest

    You right, thank you for that.
    --


    "Dennis" wrote:

    > That works if the Fieldname has a decimal but does not work for whole numbers.
    > 2.1 will round to 3 but 2.0 will also round to 3
    >
    > "Ofer" wrote:
    >
    > > Try this
    > >
    > > Select Round(FieldName + 0.5) As NewRoundUp From TableName
    > > --
    > > If I answered your question, please mark it as an answer. That way, it will
    > > stay saved for a longer time, so other can benifit from it.
    > >
    > > Good luck
    > >
    > >
    > >
    > > "Beatrix" wrote:
    > >
    > > > Hello!
    > > >
    > > > My task is to round all up:
    > > > 2.1=3
    > > > 2.2=3
    > > > ...
    > > > 2.9=3
    > > > Is it possible to do in a query?
    > > > Thank you!
     
  7. James A. Fortune

    James A. Fortune
    Expand Collapse
    Guest

    Beatrix wrote:
    > Hello!
    >
    > My task is to round all up:
    > 2.1=3
    > 2.2=3
    > ...
    > 2.9=3
    > Is it possible to do in a query?
    > Thank you!


    SELECT Int([X]) + Abs([X] <> Int([X])) AS XRoundedUp FROM MyTable;

    James A. Fortune
     

Share This Page