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
Kortney CervantesKortney Cervantes 

Formula for converting date field to YYYY-MM and I need the MM to be 2 digits (not just 8 for August, needs to be 08)

I am updating a lookup field through process builder to look up an accounting period based on a date the user selects. The accounting period format is YYYY-MM. I tried TEXT(YEAR([OpportunityLineItem].LicenseStartDate__c ))+"-" +CASE(TEXT(MONTH([OpportunityLineItem].LicenseStartDate__c )),1, "01",
2, "02",
3, "03",
4, "04",
5, "05",
6, "06",
7, "07",
8, "08",
9, "09",
10, "10",
11, "11",
12, "12",
"None") 

but I am getting an error of expecting text and returning number. Any help? 
Best Answer chosen by Kortney Cervantes
<- Deepak Rathinavelu -><- Deepak Rathinavelu ->
Hi Kortney,

Try '&' in place of '+' and put the case in the text function.
Regards
RD