Home > FAQ > Data Manipulation > Date Rounding in Expressions > Day of the year

Day of the year

January 1 is the first day of the calendar year, February 28th is the 59th day of the calendary year (31+28), and 12/31 is the 365th or 366th day of the calendar year.

  

; A_DT is a single date or an array of date(s) that you need to
; adjust (e.g., DOB field or #DATE in a transformation expression)

 

BOY_DT:= #BEGMTH (1 #FSTBUSDAY A_DT) & ; beg of year
1 + A_DT – BOY_DT ; day of year

 

This example also works for plan years, change

(1 #FSTBUSDAY A_DT) 
to
(2 #FSTBUSDAY A_DT).