Brian Dunning's FileMaker Custom Functions

DateValuesStrict ( dateBegin ; dateEnd )

Generate a return delimited list of date for the specified range.

  Average rating: 4.5 (30 votes) Log in to vote

Jonathan Stark   Jonathan Stark - Show more from this author
Jonathan Stark Consulting
http://jonathanstark.com/

Share on Facebook Share on Twitter

  Sample input:
DateValuesStrict ( "12/21/2005" ; "12/26/2005" )
  Sample output:
12/21/2005
12/22/2005
12/23/2005
12/24/2005
12/25/2005
12/26/2005

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

This is similar to the DateValues function, but it is strict. It requires both dates and dateBegin must be less than or equal to dateEnd.

 

Comments

John Davis   John Davis, Houston
Aug 8, 2015
Your parameter names don't match your code. Here is the corrected code:


Let ( [
dateList = Case (
dateBegin = "" ; "?";
dateEnd = "" ; "?";
not IsValid ( GetAsDate ( dateBegin ) ) ; "?";
not IsValid ( GetAsDate ( dateEnd ) ) ; "?";
GetAsDate ( dateBegin ) > GetAsDate ( dateEnd ) ; "?";
dateBegin = dateEnd ; dateEnd & ¶;
dateBegin & ¶ & DateValuesStrict ( GetAsDate ( dateBegin ) + 1 ; GetAsDate ( dateEnd ) )
);
result = dateList
];
result
)
 

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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: