This function returns the Date portion of a specified DateTime value.
Parameter
a - A DateTime value.
Return value
The return value is a Date.
Example
If the DateTime is Dec.25,1999 20:12:50, the return value of the following statement is 12/25/99.
ForEachDay(ToDateTime(1999, 12, 25, 20, 12, 50))
This function returns the Date of the first day of the week.
Parameter
a - A DateTime value.
Return value
The return value is a Date.
Example
If the DateTime is Oct. 15,1999 5:15:20 and it is Friday, the return value of the following statement is 10/10/99.
ForEachWeek(ToDateTime(1999, 10, 15, 5, 15, 20))
If the day in the DateTime is less than 15, this function will return to the first day of the month. If the day is more than 15, it will return to the 16th day of the month.
Parameter
a - A DateTime value.
Return value
The return value is a date.
Examples
ForEachHalfMonth(ToDateTime(1999,9,13,12,27,15))
ForEachHalfMonth(ToDateTime(1999,10,18,5,21,22))
This function returns the first day of the month in a specified DateTime value.
Parameter
a - A DateTime value.
Return value
The return value is a date.
Example
If the datetime is Sep.24,1999 12:05:56, the return value of the following statement is 09/01/99.
ForEachMonth(ToDateTime(1999,9,24,12,5,56))
If the month of a specified DateTime is before April, the function will return to Jan. 1 of the year. If the month is after April but before July, the function will return to April. 1 of the year. If the month is after July but before October, the function will return to July. 1 of the year. If the month is after October, the function will return to Oct.1 of the year.
Parameter
a - A DateTime value.
Return value
The return value is a date.
Examples
ForEachQuarter(ToDateTime(1997,2,14,2,10,23))
ForEachQuarter(ToDateTime(1999,5,28,10,10,25))
ForEachQuarter(ToDateTime(1999,8,28,10,10,25))
ForEachQuarter(ToDateTime(1998,11,11,11,40,23))
If the month of a specified DateTime is before July, the function will return to Jan.1 of the year. Otherwise the function will return to July 1 of the year.
Parameter
a - A DateTime value.
Return value
The return value is a date.
Examples:
ForEachHalfYear(ToDateTime(1999, 5, 28, 10, 10, 25))
ForEachHalfYear(ToDateTime(1998, 11, 15, 11, 40, 23))
This function will return to Jan.1 of the year.
Parameter
a - A DateTime value.
Return value
The return value is a date.
Example
If the datetime is Aug. 28,1999 10:10:25, the return value of the following statement is 01/01/99.
ForEachYear(ToDateTime(1999, 8, 28, 10, 10, 25))