Brian Dunning's FileMaker Custom Functions

DateQuarterBegin ( theDate )

Pass any date and get the quarter start date based on input date.

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

Chiyoko Yoshida   Chiyoko Yoshida
chiyofm
http://www.chiyofm.com/

Share on Facebook Share on Twitter

  Sample input:
DateQuarterBegin (7/15/2010)
  Sample output:
7/1/2010

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

Basic formula to out put the start date of the year's quarter based on the input date. Supply the get(currentdate) to dynamically get the CURRENT quarter.

 

Comments

Bruce Robertson   Bruce Robertson
Jul 17, 2010
There is no need to use $variables and there is a possible conflict with script variables. The function works just as well by removing all the "$" characters.
 
Bruce Robertson   Bruce Robertson
Jul 17, 2010
Like this:
Let ([
d = theDate;
m = Month(d);
y = Year(d)
];

Case(
m > 9 ; Date (10;1;y);
m > 6 ; Date (7;1;y);
m > 3 ; Date (4;1;y);
Date(1;1;y)
)
)
 
comment   comment, VR
Jul 19, 2010
Try =

Date ( 3 * Div ( Month ( date ) - 1 ; 3 ) + 1 ; 1 ; Year ( date ) )
 
Chiyoko Yoshida   Chiyoko Yoshida, Chicago IL
Jul 19, 2010
Nice, a much more concise statement. I wanted to write that but didn't have the time to play with the math. Thx for feedback.
 

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: