Discussions

Expand all | Collapse all

Extracting Year from datetime

  • 1.  Extracting Year from datetime

    Posted 11 days ago
    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.  RE: Extracting Year from datetime

    Posted 11 days ago
    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/
    ------------------------------



  • 3.  RE: Extracting Year from datetime

    Posted 11 days ago
    Great-- thank you!

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