Dateformular addition

ara3nara3n Member Posts: 9,255
edited 2006-09-29 in NAV Tips & Tricks
Hello
It's been a while since I've used dateformular fields. You can't just add them.

So far I've basically done this. Convert it to string and concatenate it.


evaluate(DateFormularA,format(DateFormularB) + '+' +
format(DateFormularC));


So
DateFormularB := 2D;
DateFormularC := 2D;
then
DateFormularA := 2D + 2D;

And it works

Is there a better way to do this?
Ahmed Rashed Amini
Independent Consultant/Developer


blog: https://dynamicsuser.net/nav/b/ara3n

Comments

  • zeninolegzeninoleg Member Posts: 236
    I tried summing the DataFormulas but It does not work.... At least I could not make it work.
    I tried even this:
    MESSAGE('%1', CALCDATE(DateFormula1 + DateFormula2, WORKDATE) - WORKDATE);
    
    still the same message, however
    MESSAGE('%1', CALCDATE(DateFormula1, WORKDATE) - WORKDATE);
    
    Gives the number of days in the DataFormula1 - 2D gives 2 and 2M gives 61.
    So theoretically you can sum 2 integers with number of days, get the difference, and add this difference to you existing date
    On another hand, your approach is MUCH easier............ :whistle:
    Best Regards,
    Oleg
  • ara3nara3n Member Posts: 9,255
    Great. Thanks you.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • krikikriki Member, Moderator Posts: 9,094
    [Topic moved from Navision forum to Navision Tips & Tricks forum]
    It's worth it!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.