Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

How to use a Salesforce Formula Field to display a Quarter value based on the created date

Be First!
by March 25, 2013 Configuration, SALESFORCE

How to use a Salesforce Formula Field to display a Quarter value based on the created date?

Requirement:
Want to display a Quarter value based on the created date like below,
from April to Jun – Quarter 1
from July to Sep – Quarter 2
from Oct to Dec – Quarter 3
from Jan to Mar – Quarter 4
For Example,
if one recored is created today i.e :- 25-03-2013
based on above condition the Quarter value is display like “4”
Technical Solution:
Create a formula field under the respective objects and choose the Formula Return Type as a Number.

CASE( MONTH(DATEVALUE( CreatedDate ) )  ,
4, 1,
5, 1,
6, 1,
7, 2,
8, 2,
9, 2,
10,3,
11,3,
12,3,
1,4,
2,4,
3,4,
0)

(1356)

Previous
Next

Leave a Reply