Jump to content

random numbers in a field. possible?


This topic is 7207 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am still a filemaker beginner. This is my first post so I hope this question is in the right place.

My question is: Let's say I have 4000 records in a database. Is there a way to automatically fill one of the fields for all records with numbers that are chosen randomly and that have a specific range (for example 1 as minimum and 500 as maximum)? some kind of formula maybe?

Any help is much appreciated

Link to comment
Share on other sites

FileMaker has a random number function that returns a number between 0 and 1. This function can be used to set a number field to a random number using either a looping script and the SetField statement or a replace "Replace" either executed manually or in a script. If you want a number withing a certain range this can be done with a calculation. For instance, an integer between 1 and 500 can be set using:

(Random * 499) + 1 <-- this won't return an integer

Int((Random * 499) + 1) <-- this will return an integer

-bd

Link to comment
Share on other sites

This topic is 7207 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.