Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Location
    Bogota
    Posts
    67

    Unanswered: number rounding (up only)

    Is there an Access or VBA function like Oracle's CEILING function, which takes a number and returns the next highest whole number?

    example:
    1.0 >> 1
    1.1 >> 2
    1.9 >> 2
    2.1 >> 3

    Thanks in advance.

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    None that I can find. There, I said it, someone can prove me wrong.

    Here's a user-defined function that (i hope) works:

    Function Ceil(num As Double) As Long
    ___If Abs(Int(num) - num) > 0 Then
    ______Ceil = Int(num) + 1
    ____Else
    ______Ceil = num
    ____End If
    End Function
    All code ADO/ADOX unless otherwise specified.
    Mike.

Posting Permissions

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