November 23, 200124 yr 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
November 23, 200124 yr 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
November 24, 200124 yr 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
November 26, 200124 yr Author Thank you very much.... i knew about the "random function". the number of days was what got me. Thank you once again. Peter
Create an account or sign in to comment