function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tracey Okeby LucanTracey Okeby Lucan 

Create Date with set Day value and changing month and years on Opportunities

I need to create a field that returns the 15th of any month that opportunity is closed in. I think this should be simple but I cannot make it work.  Needs to be a Date value in the end. 

So basically if an Opp is closed in June 2017 then field should display 15/06/2017

Please help?
Best Answer chosen by Tracey Okeby Lucan
jigarshahjigarshah
Tracey,

Then the formula within the formula field needs to be modified as below. I have considered the CloseDate but you can replace it with a valid Date field from the object.
DATE(YEAR(CloseDate),MONTH(CloseDate),15)
Please mark the thread as SOLVED and answer as the BEST ANSWER if it helps address your issue.

All Answers

jigarshahjigarshah
Tracey,

You can achieve this using a Formula Field that returns a Date Value. Create a new custom field on the respective Salesforce object where you intend to display the resultant Date. So if you want to display a date after 15 Days from the Opportunity ClosedDate then the formula within the formula field would be as follows
ClosedDate + 15
In case, the field that you are trying to use in the formula is of a DateTime datatype then use the DATEVALUE() function to use only the date part of the value and add the said number of days to it. Hope this helps

Please mark the thread as SOLVED and answer as the BEST ANSWER if it helps address your issue.
Tracey Okeby LucanTracey Okeby Lucan
But the Opps are closed on random dates throughout the month. I need Opps closed on 6th June, 17th June and 30th June to all have a date field return 15th June. I can just add or subtract from close date because the values would all be different. I think I need something like this but that actually works: 15 & “/“ & MONTH(CloseDate) & YEAR(CloseDate) What do you suggest? Thanks!
jigarshahjigarshah
Tracey,

Are you saying that you need the formula to add 15 Days only if the Opportunity Closed Date is 6, 17 or 30 Jun 2017?
Tracey Okeby LucanTracey Okeby Lucan
No. I need a date field that has the same month and year that the opportunity closed on but that registers the day as the 15th. It can close on any day in June but my date field must read 15/06/2017 It could close on any day in September and my date field should then read 15/09/2017 Thanks for your persistence Tracey
jigarshahjigarshah
Tracey,

Then the formula within the formula field needs to be modified as below. I have considered the CloseDate but you can replace it with a valid Date field from the object.
DATE(YEAR(CloseDate),MONTH(CloseDate),15)
Please mark the thread as SOLVED and answer as the BEST ANSWER if it helps address your issue.
This was selected as the best answer
Tracey Okeby LucanTracey Okeby Lucan
Thank you!