Newer Version Available

This content describes an older version of this product. View Latest

First Day in the Week, Month, Quarter, or Year

Returns the date of the first day in the specified week, month, quarter, or year.

Usage

Use these functions in a foreach() statement. You cannot use them in group by, order by, or filter statements.

Use the functions whose names begin with week, month, quarter, and year with standard calendar year dates. Use the functions whose names begin with fiscal with fiscal year dates.

You can't use fiscal date functions in recipes and dataflow transformations.

Note

week_first_day(date)

Returns the date of the first day of the week for the specified date.

This function always counts the firstDayOfWeek as 0 (Sunday). It overrides the firstDayOfWeek parameter for sfdcDigestTransformation and CSV uploads.

Note

fiscal_week_first_day(date)

Returns the fiscal date of the first day of the week for the specified date.

This function respects the firstDayOfWeek parameter for sfdcDigestTransformation and CSV uploads. The default value is 0 (Sunday).

Note

month_first_day(date)

Returns the date of the first day of the month for the specified date.

fiscal_month_first_day(date)

Returns the fiscal date of the first day of the month for the specified date.

quarter_first_day(date)

Returns the date of the first day of the quarter for the specified date.

fiscal_quarter_first_day(date)

Returns the fiscal date of the first day of the quarter for the specified date.

year_first_day(date)

Returns the date of the first day of the year for the specified date.

This function always returns 1st January.

Note

fiscal_year_first_day(date)

Returns the fiscal date of the first day of the year for the specified date.