FileMaker - A date range Custom Function

Here's a Custom Function I've called iDateRange for FileMaker which will create a list of dates based on a date range. You can cut and paste the text directly into Manage Custom Functions.

If ( StartDate < EndDate ;

    iDateRange ( StartDate + 1 ; EndDate ; If ( DateList = "" ; StartDate ; DateList &¶& StartDate ) ) ;

    If ( DateList = "" ; StartDate ; DateList &¶& StartDate )

)

/*-----------------------------------------------------------------

Created : J Fairhead / igeek 2013

Purpose : Creates a ¶ delimited list of dates based on a supplied date range

Example :

    iDateRange ( GetAsDate ( "01/01/2013" ) ; GetAsDate ( "05/01/2013" ) ; "" )

Result :

    01/01/2013

    02/01/2013

    03/01/2013

    04/01/2013

    05/01/2013

-----------------------------------------------------------------*/

Please be aware that there is no error checking in iDateRange on the start / end dates so I'd recommend that you include something at the field level which makes appropriate checks (date range isn't too large, start date is less than the end date, etc).

And here's the iDateRange FileMaker Custom Function screenshot:




If you notice anything wrong with this blog, think that you can do it better or just want to discuss it, then please get in touch.


Blog entry is closed for new comments.