pbucc Posted November 23, 2001 Posted November 23, 2001 hi there everyone... i have a little project that i am trying to finish. i have a field that is a date. i'm trying to create a script that will create a random date with a range of the year 2000 and 2001. the dates can be duplicated just within these years. any help would be great... thanx
LiveOak Posted November 23, 2001 Posted November 23, 2001 In FM dates are stored as number of days starting at January 1, 1900. to generate a random date you can use the Random function to pick a random number between zero and one and scale by the date range you wish. Your function might look like: RandomDate (calculation, date) = Date(1,1,2000) + Int(730 * Random) This should be a stored calculation so that once selected it doesn't recalculate. -bd
Steven H. Blackwell Posted November 24, 2001 Posted November 24, 2001 quote: Originally posted by LiveOak: In FM dates are stored as number of days starting at January 1, 1900. -bd Whoops. I think you'll find that it is actually January 1,0001, not January 1, 1900. Of course there was no such date as Janaury 1,0001, but FileMaker Pro treats it as 1. HTH Old Advance Man
pbucc Posted November 26, 2001 Author Posted November 26, 2001 Thank you very much.... i knew about the "random function". the number of days was what got me. Thank you once again. Peter
Recommended Posts
This topic is 8402 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