Home > FAQ > Data Manipulation > Date Rounding in Expressions > Beginning of the current ... examples > Beginning of the current quarter (plan year)

Beginning of the current quarter (plan year)

This is the recommended expression for rounding dates to the beginning of the current plan year quarter:

BOY1_DT:= #BEGMTH (6 #FSTBUSDAY A_DT) &
; find the first business day of the current plan year quarter, then round that 
; first business day to the beginning of month (i.e., first day of the quarter)

A_DT may be either a single date (e.g., 7/16/2015, DOH, #DODEC) or an array of dates (e.g., #DATE).

We start with #FSTBUSDAY because it's the easiest way to work with plan years, but then we need to use #BEGMTH to guarantee that we are at the beginning of the quarter. 6 #FSTBUSDAY A_DT finds the first business day of the plan year quarter, which is either the first, second, or third day of the current plan year quarter, depending on whether the first day of the current plan year quarter is a weekday, Sunday or Saturday. If #FSTBUSDAY returns the second or third day of the plan year quarter, #BEGMTH converts it to the first day.