You need to sign in to do that
Don't have an account?

calculate the given date minus 6 months
Hi All,
I have field on opportunity which shows contract expiration date ,but a reminder should be sent to opportunity owner before 6 months .I need a formula to calculate today()-6 months, i tried Today()-180 but it misses some days.
Thanks for your help in advance!........
Regards,
Krishna.
I have field on opportunity which shows contract expiration date ,but a reminder should be sent to opportunity owner before 6 months .I need a formula to calculate today()-6 months, i tried Today()-180 but it misses some days.
Thanks for your help in advance!........
Regards,
Krishna.
The next leap day is February 29, 2020.
The last Leap Day was on February 29, 2016.
This formula does the following:
- February (2) 28 days
- April (4), June (6), September (9), November (11) 30 days
- Else 31 days.
OK: if not a leap yearBut ;
False because : 2, 28, but correct if changed into: 2, 29, but that works only in 2019-2020.
https://help.salesforce.com/articleView?id=formula_examples_dates.htm&type=0
Regards
All Answers
Your formula is a estimate, it doesn’t return an exact date.
Adding Days, Months, and Years to a Date: Adding months to a date is slightly more complicated as months vary in length and the cycle of months restart with each year.
This example formula adds six months to a given date. You can modify the conditions on this formula if you prefer different behaviors for dates at the end of the month.
https://help.salesforce.com/articleView?id=formula_examples_dates.htm&type=0
Regards
Alain
The next leap day is February 29, 2020.
The last Leap Day was on February 29, 2016.
This formula does the following:
- February (2) 28 days
- April (4), June (6), September (9), November (11) 30 days
- Else 31 days.
OK: if not a leap yearBut ;
False because : 2, 28, but correct if changed into: 2, 29, but that works only in 2019-2020.
https://help.salesforce.com/articleView?id=formula_examples_dates.htm&type=0
Regards
Thank you for your quick support ,i will try the same and let you know the result.Mean while i tried with another formula
IF
(
MONTH(Contract_Expiration_Date__c) < 7
,
DATE
(
YEAR(Contract_Expiration_Date__c) - 1,
MONTH(Contract_Expiration_Date__c) - 6 + 12,
DAY(Contract_Expiration_Date__c)
)
,
DATE
(
YEAR(Contract_Expiration_Date__c),
MONTH(Contract_Expiration_Date__c) - 6,
DAY(Contract_Expiration_Date__c)
)
)
Regards,
Krishna.
But when i give the date field like june 30,it is throwing an error.can you please help on this.
I prefer to chose previous date when the 31 doesn't exist.But also for the 30th month it is showing the above error.Can you please modify the formula according to these two conditions .Can you please help me on this.
Regards,
Krishna.
Here is the good solution (including the leap years):
Chun Wu - 4 years ago This is the version of subtracting months:
https://success.salesforce.com/ideaview?id=08730000000BrQ2AAK
test_date - test number (of month) :
Regards