Function: FirstDay
Description
Returns the date of the first day of the interval in which the given date falls, where interval_type specifies the type of time interval.
Syntax
FirstDay(date,interval_type)
Arguments
Date may be any valid date in the range 1/1/1601-12/31/2400. Interval_type is a string which specifies the type of time interval. Possible values are "year", "halfyear", "quarter", "month", "week", "day", "fiscal_year", "fiscal_halfyear", "fiscal_quarter", "fiscal_period", "fiscal_week", "iso_year", and "iso_week".
Return Value
This function returns a date.
Calculated field example
If the Ship Date field contains a value of 4/21/2008, the following expression will return a value of 4/1/2008: FirstDay([Ship Date],"quarter")
Filter/find example
The following expression would select or find all the orders shipped on the first day of the current quarter: [Ship Date]=FirstDay([Ship Date],"quarter")
Note: The example above assumes that the following time intervals settings have been specified via the Time Intervals wizard:
-
The fiscal year consists of 12 calendar months starting on January 1.
-
The fiscal week is defined as the first week of the year that starts on January 1, regardless of what day of the week it is.
-
The calendar week is defined as the first week of the year that starts on January 1, regardless of what day of the week it is.
© 2024 Altair Engineering Inc. All Rights Reserved.