End of the current quarter plan year
This is the recommended expression for rounding dates to the end of the plan year quarter:
EOQ_DT:= #ENDMTH (6 #LSTBUSDAY A_DT) &
; find the last business day of the current plan year quarter, then round that last business day
; to the end of the month
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 #LSTBUSDAY because it's the easiest way to work with plan years, but then we need to use #ENDMTH to guarantee that we are at the end of the plan year quarter. 6 #LSTBUSDAY A_DT finds the last business day of the current plan year quarter, which is one of the last 3 days of the current plan year quarter, depending on whether the last day of the current plan year quarter is a weekday, Sunday or Saturday. Then #ENDMTH converts it to the last day of the month (i.e., the last day of the current plan year quarter).