Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    128
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Putting the 6 numbers in an order

    Hi,

    I get 6 numbers from my database on the same record. (each record has number1,number2,number3,number4,number5,number6 fields) I want my code check which the smaller one is for each record. Maybe there's an easy way to do it. But my brain is stopped. Can anyone help

    Thanks
    telmessos

  • #2
    Regular Coder
    Join Date
    Apr 2006
    Posts
    128
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Hi all,

    After I posted this question, I focused on the idea again and made it the following way. I hope in the future you need such thing and will help someone in the forum

    Dim myArray2(5)
    myArray2(0) = ors2.Fields("period1").value
    myArray2(1) = ors2.Fields("period2").value
    myArray2(2) = ors2.Fields("period3").value
    myArray2(3) = ors2.Fields("period4").value
    myArray2(4) = ors2.Fields("period5").value
    myArray2(5) = ors2.Fields("period6").value
    smallestnumber = ors2.Fields("period1").value
    for i = 1 to 5
    if myArray2(i) < smallestnumber then
    smallestnumber = myArray2(i)
    end if
    Next

    Thanks


  •  

    Posting Permissions

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