You need to sign in to do that
Don't have an account?
Nick Paiva
Formula: Convert today's date to month and year?
Hey guys,
Simple formula question. I'm trying to take a date field and return a year and month.
In my flow, I'm trying to make a Get Records criteria:
Due_Date__c - Equals - (This month and year formula).
I currently have: DATE(YEAR(TODAY()),MONTH(TODAY()),1)
And it seems to be returning: March 1st, 2019. Rather than March 2019.
Thanks,
Nick
Simple formula question. I'm trying to take a date field and return a year and month.
In my flow, I'm trying to make a Get Records criteria:
Due_Date__c - Equals - (This month and year formula).
I currently have: DATE(YEAR(TODAY()),MONTH(TODAY()),1)
And it seems to be returning: March 1st, 2019. Rather than March 2019.
Thanks,
Nick
CASE(MONTH(Due_Date__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',''
)+' '+TEXT(YEAR(TODAY()))
I think the formula would have worked, but it didn't like it because of the "TEXT," as the system is looking for a DATE. Which perhaps that means what I'm trying to achieve might not be possible?
Is there potentially a way to add a month to a date?
So I could do, criteria:
Due Date - greater than or equal - DATE(YEAR(TODAY()),MONTH(TODAY()),1)
and
Due Date - Less than - DATE(YEAR(TODAY()),MONTH(TODAY()),1) (Plus one month)
So it'd be greater than or equal to March 1st, 2019, but less than April 1st, 2019.
You can also test that :MONTH( due date ) = MONTH ( today ) and YEAR( due date ) = YEAR( today )
I am not sure for you scenario but try below code:
YEAR(TODAY()),MONTH(TODAY())
or
DATE(YEAR(TODAY()),MONTH(TODAY()))
for more info visit:
https://www.excel-exercise.com/function-date-year-month-day/
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
You can try the below formula:
TEXT(MONTH(TODAY())) + "," + TEXT(YEAR(TODAY()))
I've tried the same in my org and seems useful to me. Please have a look to the Screeshots I've attached that may be helpful to you:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
and
Due Date - Less than - DATE(YEAR(TODAY()),MONTH(TODAY()),1) (Plus one month)
Due Date - Less than - DATE( YEAR(TODAY()) , MONTH(TODAY()) +1 , 1 )