Split a date field into YYYY-MM or YYYY format | Community
Skip to main content
Srinija_N
Level 7
Nov 19, 2024 10:59 AM UTC
Solved

Split a date field into YYYY-MM or YYYY format

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Srinija_N
Srinija_NAccepted solution
Level 7
Nov 19, 2024 2:49 PM UTC

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

5 replies

Srinija_N
Srinija_NAuthorAccepted solution
Level 7
Nov 19, 2024 2:49 PM UTC

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
Translate
Madalyn_Destafney
New Participant
Nov 19, 2024 2:02 PM UTC

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.

Translate
If this helped you, please mark correct to help others : )
Srinija_N
Srinija_NAuthor
Level 7
Nov 19, 2024 2:46 PM UTC

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

Translate
Madalyn_Destafney
New Participant
Nov 19, 2024 3:08 PM UTC

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

 

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