Welcome to SPN

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

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95   Become a Supporter    ::   Make a Contribution    Let's do it!

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
    GURU NANAK’S VISIT TO OTTOMAN EMPIRE-BACKGROUND New to Sikhism Jan 19, 2017
    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

  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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page