Working with Relative Date Ranges

Working with dates within FileMaker isn’t as complex as working on launching a rocket to the moon. But, as with most all technical things, it’s always good to know what’s going on under the hood. Knowing how things work allows you to implement the desired solution in the most efficient manner.

When talking about relative dates we’re talking about “Today”, “Tomorrow” and “Last Year”, not 7/6/1996. You can always instruct FileMaker to lookup a date range based on the whole year of 1995, but isn’t it nicer to simply provide the user with a menu with options relative to the current date.

In this video we take a look at the method of using relative date ranges in order to specify the starting and ending dates of those ranges. We do this using a Custom Function and some of the available triggers.

If you have any type of date-based data and you’re looking for an easy way to present things to your users, then you’ll likely find what you’re looking for in this video.

AttachmentSize
RelativeDateRanges.zip369.63 KB

Comments

I'm basically a beginner and I do not understand why you're using a tilde before, what appears to be variables. I thought they all had to be $ or $$. Thanks for your help.

There are three types of variables within FileMaker. One which is local only within a Let () function, one which is scoped to just the script level and one which is scoped to the file level.

The tilde is just a nomenclature method for identifying variables which are scoped to the level of the Let() function. The tilde helps them stand out when intermingled amongst other data, literals and field references.

I hope this helps out and makes sense. More information is here.

http://filemakerstandards.org/x/R4AI

-- Matt Petrowsky - ISO FileMaker Magazine Editor

Very useful Custom Function for the date ranges. Wish I'd had this earlier this year when I had the task of reporting on various date ranges. Will be adding to it for "Previous Month, Week and Day".

Feel free to send me any revisions you make and I can integrate into the version I end up pushing to my GitHub repository.

-- Matt Petrowsky - ISO FileMaker Magazine Editor