Date field to show only year

attardcattardc Member Posts: 97
I added a new field to the item card - Year of Manufacture of type Date. I need to store, or at least show only the year (2008) not the whole date. Is this possible in any way?

thanks a lot

Comments

  • kinekine Member Posts: 12,562
    You can use the FORMAT function to format the output just to the Year. Or you can use the OnFormat trigger to format the output...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from Navision Tips & Tricks forum to Navision forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SavatageSavatage Member Posts: 7,142
    go to the field on your form thru designer. View Properties
    change SourceExp to
    FORMAT("Your Date Field",0,'<year4>')
    

    The table will store the whole date - but the display will just be the year.
  • garakgarak Member Posts: 3,263
    edited 2008-07-03
    the format function is to see, if you will store only the year, and also in filter need only the your (only see 2000, 2005 ...), u can use the function
    "Your Field" := DATE2DMY(YOURDATE,3);
    

    Regards
    Do you make it right, it works too!
  • SavatageSavatage Member Posts: 7,142
    might as well pile on :lol::lol:
    How about just a 4 digit Integer field or text field :mrgreen:
    screw the whole date thing. :wink:
Sign In or Register to comment.