What day is it?

One of a series of articles describing a Filemaker Pro ™ technique.

Dates and times are handled so easily in  Filemaker Pro ™ but it’s still worth laying out what we know about them and how we manipulate and use them  in some fun ways.

What day is it?  

This is the first thing for a couple of reasons.  

We need to get some things straight and we may as well do that right up front.

When you first read this question, what did you think was the answer?  Depending on the date where you are in time, you might think “Wednesday”.  If you have been working in  Filemaker Pro ™ for very long, you’d know better. 

🙂

When talking about date and or time, we are dealing with one of these…

Date, Day, DayName, DayOfYear, WeekOfYear, WeekOfYearFiscal, Year, YearName, Hour, Minute, Seconds, Time and TimeStamp.

So let’s answer the question… What day is it?

Dates are made of Months, Days, and Years. When we ask, ‘Hey Jenny, what’s the date?’, we’re usually looking for that middle number.  The answer we expect is something like the 5th or the 19th so what we’re looking for is that number in the middle… the Day.

When playing with dates, the most common function used is likely to be Get(CurrentDate).   Just like it looks, this function will return the date in a MM/DD/YYYY format (e.g. as I’m writing this, the function would return 9/18/2018).  What we want to do is retrieve the Day from that date.  In this case, the answer would be retrieved by using this bit of math:

Day ( Get (CurrentDate)) 

and of course, the return would be 18.

If we take that apart just a bit, we see that we’ve used the Day() function and the Get(CurrentDate) function together by wrapping the former around the latter.  When you consider that one of the primary characteristics that describes a function is that it returns something, then you see that each of these functions returned something… one returned todays date and other returned the day of that date.

The Day() function is shown in the help reference as “Day (date)”.  What this is trying to show is that the Day function requires a date in the parenthesis.  We give it that date by “passing in” a function that results in a date (in this case), or we can put the name of a field in that place and have it tell us the Day of the contents of the field, or we can even build a date in that space… more about that in other Things..

Leave a Reply

Your email address will not be published. Required fields are marked *