I have Pin field which is a formula field and PIN should be DDMM part of DOB of customer.

I have written a foll formula and it gives error

DAY( Customer_id__r.Date_of_Birth__c )  & MONTH(Customer_id__r.Date_of_Birth__c)

and the error is

Incorrect parameter type for operator '&'. Expected Text, received Number (Related field: Formula)

Can some one help pls


The & concatenation operator expects the left operand and right operand to be text. But DAY(Customer_id__r.Date_of_Birth__c) returns integer and so throws syntax error.

You can surround the DAY and MONTH functions with TEXT() function like

TEXT(DAY(Customer_id__r.Date_of_Birth__c)) & TEXT(MONTH(Customer_id__r.Date_of_Birth__c))

Hope it helps.


You should use like this

text(day(Customer_id__r.Date_of_Birth__c)) +'&' + text(month(Customer_id__r.Date_of_Birth__c))

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.