0

I want to derive the month of a date field called MeetingDate__c. Purpose of this is to display all Meeting Records grouped by the derived month. I have created a formula field to derive the month from MeetingDate field but it doesnt save:-

MONTH(MeetingDate__c)

Error message display is :-

Error: Formula result is data type (Number), incompatible with expected data type (Date).

Also is there a way that I can show the name of the month instead the number of the month? Ex: If derived month is 05 then display May ?

1

This error is mainly because the type of Formula which you selected is Date and it should be Number. Change the formula return type to Number

Also, for getting the month name, change your formula to below

CASE(MONTH(MeetingDate__c),
1, "January",
2, "February",
3, "March", 
4, "April", 
5, "May", 
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December",
"None")

This formula will first fetch the month from the date. Then using Case function, you can get the text value for the month. Also, now change the type of the formula to Text.

Refer Functions in Formula

| improve this answer | |
  • I had to change return type to Text as it returns the name of the month. Apart from that the solution worked! – Tinkerbell Aug 4 '17 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.