Brian Dunning's FileMaker Custom Functions

RandomDate

creates a random date between the specified first and last dates, inclusive

  Average rating: 4.6 (21 votes) Log in to vote

Jeff Drake   Jeff Drake
Drakeling Technologies

Share on Facebook Share on Twitter

  Sample input:
RandomDate (

Date ( 1 ; 1 ; 2015 ) ;

Date ( 9 ; 4 ; 2015 )

)
  Sample output:
4/6/2015

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This function is designed to aid in creating “dummy” data for your FileMaker Pro database. For example, you can specify a calculation in the “Calculated value” dialog under field options and have a random date entered into each new record.

 

Comments

unin   unin, Japan
Sep 10, 2015
dateFirst + Int ( Random * ( dateLast - dateFirst + 1 ) )

Using Int() for Random is the programming pattern.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.