Richard Corso Posted April 25, 2010 Posted April 25, 2010 I am trying to set a field to pull a random number each time a record is created. I have a field named "Dice" with a calculation "1" - "100" * Random And a field named "randam_number" with the calculation Middle (Dice; Position (Dice; "-"; 1; 1) + 1; Position (Dice; "."; 1; 1)-2) At first this seams to work just fine. I get numbers like 59, 18, 89 or 7. Buy every once in a wile I get a blank field. Any ideas.
comment Posted April 25, 2010 Posted April 25, 2010 Well, "1" - "100" * Random returns a number between 0 and -98.9̅9̅9̅9̅9̅ Then, your calculation returns blank whenever Dice is between 0 and -.9̅9̅9̅9̅9̅ and also when Dice is an integer - roughly, in 1% of the cases. Why not use simply: Int ( Random * 99 ) + 1
Recommended Posts
This topic is 5384 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now