Salesforce

How Do I Calculate the Beginning of the Year of a Given Date? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Calculate the Beginning of the Year of a Given Date? (Magic xpa 3.x)

It is very often the case that one needs to compute the first day of the year, especially for setting the date range for reports. There is a very quick way to do this, using the BOY() function.

Using the BOY() function

The syntax of BOY() is:

BOY(date)

Where date is any date variable (or a hard-coded date, such as '05/06/2008'DATE, or an expression that evaluates to a date). It returns the first day of the year.

See also

The Online and Rich Client Samples projects (program DT09 and RDT09)

Reference
Attachment 
Attachment