1

How can I build a formula to extract the year of a date field? I'm trying to do this with the field DateofBirth of datatype date.

For example if DateofBirth=1980-12-19 00:00:00, I want the formula to evaluate to the year=1980

2 Answers 2

1

According to your question. try with this. This should work

RIGHT(LEFT(TEXT(DateofBirth),4),4) 
2
  • 1
    this is way off from the correct answer
    – o-lexi
    Feb 11, 2017 at 17:45
  • Even if you want to use TEXT...you should just use MID to get the correct substring.
    – Adrian Larson
    Feb 11, 2017 at 19:34
5

If you have a Date field, you can simply use the YEAR() formula function

The reason why you want to use this over manually splitting up a date string (besides it being shorter) is because the display format of a date/datetime field depends on the locale of the user.

There are lots of locales, and not all of them have the year in the same place (first good examples I found were Azerbaijan and Belarus).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .