This function calculates the day number of the year in which a timestamp falls. The calculation is made from the first millisecond of the first day of the year, but the first month can be offset.
Return data type: integer
The function always uses years based on 366 days.
|timestamp||The date to evaluate.|
|start_month||By specifying a start_month between 2 and 12 (1, if omitted), the beginning of the year may be moved forward to the first day of any month. For example, if you want to work with a fiscal year starting March 1, specify start_month = 3.|
These examples use the date format DD/MM/YYYY. The date format is specified in the SET DateFormat statement at the top of your data load script. Change the format in the examples to suit your requirements.
|DayNumberOfYear('12/09/2014')||Returns 256, the day number counted from the first of the year.|
|DayNumberOfYear('12/09/2014',3)||Returns 196, the number of the day, as counted from 1 March.|
Add the example script to your app and run it. Then add, at least, the fields listed in the results column to a sheet in your app to see the result.
LOAD recno() as InvID, * INLINE [
DayNumberOfYear(StartDate,4) As DayNrYear
Drop table ProjectTable;