Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi,

    I need to round a number and am not sure what to use for the formula. No matter what the number equals I need it to drop any numbers after the decimal without rounding up. So, if the number = 444.9, the result should be 444. If I use the formula round([number],2) it goes to 445. I need it to be 444.
    Thanks,
    Leesha

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    You need either the Int function or the Fix function.

    This is from Help and explains he difference between them.
    Both Int and Fix remove the fractional part of number and return the resulting integer value.

    The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
    Regards
    John



  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi John,

    Thanks for the info. I've never used either of these and when I type in "int function" or "fix function" in access help the only thing that comes up with references to sql. I didn't see examples of how to use either of these functions in a query. Is this even possible?

    Thanks,
    Leesha

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Int and Fix are VBA functions, so if you want to look them up, you should do so from the Visual Basic Editor.
    Like most VBA functions, they can be used in queries and in expressions, for example like this:

    Amount: Int([UnitPrice]*[Quantity])

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks Hans! That worked great and the info helped me to "see" it and understand it.

    Leesha

Posting Permissions

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