Salesforce

How Do I Calculate the End of the Month 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 End of the Month of a Given Date? (Magic xpa 3.x)

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

One of the nice things about EOM() is that it handles leap years correctly, as shown in the example.

Using the EOM() function

The syntax of EOM() is:

EOM(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 last day of the month.

See also

The Online and Rich Client Samples projects (program DT10 and RDT10)

Reference
Attachment 
Attachment