Creating a field to add the Month from a Date field

Creating a field to add the Month from a Date field

Hi All

We have had requirements in the past were clients needed a field to show only the month from a date field. This is a common requirement for fitness centres or other businesses needing to show a report on things like 'Client Join Month'. This can be achieved by adding a Formula field to your module (leads, contacts, accounts etc) in CRM. Here's is the nifty formula to add to the formula field:

If(Month(${Contacts.Join Date})==1,'January',
If(Month(${Contacts.Join Date})==2,'February',
If(Month(${Contacts.Join Date})==3,'March',
If(Month(${Contacts.Join Date})==4,'April',
If(Month(${Contacts.Join Date})==5,'May',
If(Month(${Contacts.Join Date})==6,'June',
If(Month(${Contacts.Join Date})==7,'July',
If(Month(${Contacts.Join Date})==8,'August',
If(Month(${Contacts.Join Date})==9,'September',
If(Month(${Contacts.Join Date})==10,'October',
If(Month(${Contacts.Join Date})==11,'November','December')))))))))))

All you need to do is replace the  ${Contacts.Join Date} field tag in this formula with the name of your date field. 

You can also make the month names shorter in the formula, eg 'Jan' instead of 'January'.  

To test it create a record and add the date in your date field and save. You should see the formula field add the month.  

Note that after adding a formula field it will not automatically update all existing records. The formula field will work the next time an existing record is edited.

If you need to have all existing records reflect the month in the formula field then you can mass update records. The way I have done it with clients in the past is to add a checkbox field to the module and call it for example 'Update Month'. Then select all your existing records and do a mass update and select this checkbox field and save. Then go back into the records and you should see the new formula field has added the month.

Please leave your comments or select the thumbs up icon if you found this post helpful.