Nov 20, 2020 10:31 AM
Is there a formula where I can convert a date in a date field to a string of numbers? For example, for today (2020-11-20) I would like it to return “201120”
Solved! Go to Solution.
Nov 20, 2020 11:07 AM
Hi @Kelly_Brask,
You should be able to do this with the DATETIME_FORMAT()
function.
DATETIME_FORMAT(
{Date Field},
'YYMMDD'
)
Nov 20, 2020 11:07 AM
Hi @Kelly_Brask,
You should be able to do this with the DATETIME_FORMAT()
function.
DATETIME_FORMAT(
{Date Field},
'YYMMDD'
)
Nov 21, 2020 04:26 PM
This worked perfectly, thank you so much @Jeremy_Oglesby!
Nov 22, 2020 05:59 AM
Note that this solution will look like a number but it will actually be a text string. If you need the value to behaving like a number, you will need to wrap it in the VALUE
function.
Note that some operations such as sorting can be done on text strings, but other operations such as adding or multiplying need to be done on a number.
Nov 23, 2020 12:24 PM
OK, Kelly, breathe, breathe… Try not to freak out that Kuovonne, of the September virtual conference and other videos fame, just answered your question!!!
Hey Kuovonne, thanks! Yes, I just want to use the date as the invoice number, but appreciate your feedback and have been wanting to learn more about the VALUE function.
Nov 23, 2020 01:57 PM
:joy:
Nov 23, 2020 02:42 PM
Oh dear. :blush: Don’t freak out. I’m just a human like anyone else.
I’ve learned a large part of what I know because other people in this community have been generous in sharing their knowledge.
If you want to learn more about VALUE()
, it is explained in the formula field reference, as the last entry under Numeric functions.
Nov 23, 2020 06:02 PM
Thanks Kuovonne :slightly_smiling_face: I really admire how you taught yourself so much and so well! You’ve been very inspiring in the videos I’ve seen. That project with the book about plants? Amazing.
Nov 23, 2020 06:41 PM
Thanks. By the way, @Jeremy_Oglesby, who actually answered your initial question, is a total star in this community. He is also one of the people that I have learned a lot from, and he was very welcoming when I first started posting in this community.
Nov 23, 2020 07:09 PM
Absolutely! Did not mean to overlook your quick help @Jeremy_Oglesby :slightly_smiling_face:
I am very impressed with the know-how and generosity of this community. It makes learning more fun!