+ Start a Discussion
Mayank SinghalMayank Singhal 

Date Calculation from month

I have a date let 28-02-2012(dd-mm-yyyy)

 

if i want to add number of months depending on picklist value say

 

"monthly"

 

date become 28-03-2012 or 30-03-2012

 

"Quarterly"--> 28-05-2012

 

"halfyearly"--> 28-08-2012

 

yearly-> 28-02-2013

 

if date is 15-12-2012

 

monthly->15-01-2013

quarterly->15-03-2013

halfyearly->15-06-2013

yearly->15-12-2014

 

 

how its formula is to be written

 

sourav046sourav046
Are you asking us the question ? or you asking us that the way you did is correct or not ? Things can be achieved in many ways.Tell us how did you wrote your formula .
Mayank SinghalMayank Singhal

i want to know its formul..?? how it can be written..

Jeff MayJeff May

You would use an IF statement, and test your picklist with ISPICKVAL().  The, use the Date functions to add a different number of years/months/days.

 

For example:

 

IF(ISPICKVAL(Period__c,'Monthly'), DATE(YEAR(DateField),Month(DateField)+1,DAY(DateField)), DateField)

 

Using the online help for these functions should get you going.

Mayank SinghalMayank Singhal
i want to know how its formula can be written...??? i want the formula for this..