BEGINOFPERIOD function
BEGINOFPERIOD (<Period Date>, <Period Type>)
<Period Date> is a DATE type expression used to specify the period date;
<Period Type> is one of the available period types: MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR, TENDAYS, HALFYEAR.
This function is used to obtain a period start date based on a date within the period range.
Examples:
SELECT BEGINOFPERIOD(DATETIME(2002, 10, 12, 10, 15, 34), MONTH)
Result:
Field1
01.10.2002 0:00:00
SELECT BEGINOFPERIOD(DATETIME(2002, 10, 12, 10, 15, 34), DAY)
Result:
Field1
12.10.2002 0:00:00
See also: Functions of Query Language