Home > FAQ > Data Manipulation > Date Rounding in Expressions > Beginning of the current ... examples > Beginning of the current month

Beginning of the current month

These are the recommended expressions for rounding dates to the beginning of the current month:

BOM_DT:= #BEGMTH A_DT &

or

BOY1_DT:= (-1) #MONTHROUND A_DT &

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

Note: if you subtract the day of the month from a date, you get the end of the previous month; then adding 1 day gives you the beginning of the current month:

BOM_DT:= 1 + A_DT - #DAY A_DT &