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

Month and Year Function



   I am trying to create a workflow with a field update that basically combines the month of the current date and the year of the current date. I have the field set up as a number, and this is the formula I am using. For some reason I am getting an error message. Below is the formula, what am I doing wrong? Any help is appreciated, thanks!



Best Answer chosen by Admin (Salesforce Developers) 
That worked great! Thanks for your help!!

All Answers


 The problem is that you're trying to perform the & operation, which operates on text, on variables that are numbers.  To fix this, the easiest way would be to convert each aspect to text:




The formula will output text instead of number, but for your purposes (you probably wouldn't sort by this value if you're putting the month first) this should work fine.

That worked great! Thanks for your help!!
This was selected as the best answer