Forum Discussion

RobinWendler's avatar
RobinWendler
Qrew Member
4 years ago

Extracting Year from datetime

I know this must be dead simple, but I am utterly new at this.

I have a datetime field "Entry Date", from which I want to create a Year field. 

 With the Year field as a Formula-Date type, I tried

  • Year([Entry Date]) =  Error: "expecting date but found datetime"
  • Year(ToDate([Entry Date])) = Error: "expecting date but found number"
I tried a lot of other things, changing the field types in various permutations, but haven't gotten it right.  What will do the trick?

------------------------------
Robin Wendler
------------------------------

2 Replies

  • Robin -

    So close! You've got the right formula - Year(ToDate([Entry Date])) , but the field type is incorrect. The resulting value is a numeric value, not a date. Your formula field needs to be a Formula Numeric instead of a Formula Date.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------
    • RobinWendler's avatar
      RobinWendler
      Qrew Member
      Great-- thank you!

      ------------------------------
      Robin Wendler
      ------------------------------