Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!
SOLVED

Split a date field into YYYY-MM or YYYY format

Avatar

Level 4

I have a date field in the general format MM-DD-YYYY. Now I need two new fields out of it in YYYY-MM and YYYY format. Can this be done via text mode view?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 4

I was able to find the text mode by myself anyway.

YYYY/MM:

valueexpression=CONCAT(YEAR({lastLoginDate}), '/', MONTH({lastLoginDate}))

 

YYYY format:

valueexpression=YEAR({lastLoginDate})

 

and also found the below for any other formats.

Format Example valueformat=

MM/DD/YY10/11/18atDate
MM/DD/YY Time10/11/18 12:00pmlongAtDate
MM/DD/YY10/11/18shortAtDate
Mth, DD, YROct, 11, 2018mediumAtDate
DW, Mth, Day, YRMon, Oct, 11, 2018partialAtDate
DW, Mth, Day, YR TimeMon, Oct, 11, 2018 12:00 pmfullAtDate

View solution in original post

5 Replies

Avatar

Community Advisor

Are you wanting to show the date fields in columns in a report? If so, you pull in the date field into your column and then in the advanced options of that column, you can select how you want the date field to appear/format.

If this helped you, please mark correct to help others : )

Avatar

Level 4

There is no option to change the format in the advance options of the field. (May be due to the field is Standard)

Avatar

Community Advisor

Hm interesting. When you have the date field in a report column > advanced options > you should see this dropdown.

Screenshot 2024-11-19 at 10.07.06 AM.png

If this helped you, please mark correct to help others : )

Avatar

Level 4

Even I felt weird when I didn't see these options for the date formats, So I had to go with the text mode. 

Thanks Anyway  

Avatar

Correct answer by
Level 4

I was able to find the text mode by myself anyway.

YYYY/MM:

valueexpression=CONCAT(YEAR({lastLoginDate}), '/', MONTH({lastLoginDate}))

 

YYYY format:

valueexpression=YEAR({lastLoginDate})

 

and also found the below for any other formats.

Format Example valueformat=

MM/DD/YY10/11/18atDate
MM/DD/YY Time10/11/18 12:00pmlongAtDate
MM/DD/YY10/11/18shortAtDate
Mth, DD, YROct, 11, 2018mediumAtDate
DW, Mth, Day, YRMon, Oct, 11, 2018partialAtDate
DW, Mth, Day, YR TimeMon, Oct, 11, 2018 12:00 pmfullAtDate