Convert DateFormula to text

ta5ta5 Posts: 1,164Member
Hi experts
Is it possible to convert a DateFormula to text?
Example: Input=3M, Output=3 Months

Detail: FORMAT works, but returns just 3M as a text string.

Documentation for FORMAT does not mention DATEFORMULA...

Thanks in advance.
Thomas

Best Answers

Answers

  • ta5ta5 Posts: 1,164Member
    Hi AK
    Sorry for late answer. I'll try that, thank you for helping.
    Thomas
  • ta5ta5 Posts: 1,164Member
    Hi Remco

    Awsome idea, this works very nice!
    EVALUATE(myDateFormula,'<6D>');
    
    myDate := TODAY;
    myDateTime := CREATEDATETIME(myDate,0T);
    
    myDate2 := CALCDATE(myDateFormula,myDate);
    myDateTime2 := CREATEDATETIME(myDate2,0T);
    
    myDuration := myDateTime2 - myDateTime;
    
    MESSAGE('Result %1',myDuration);
    

    Thanks a lot, thanks for contributing!

    Thomas
  • vaprogvaprog Posts: 837Member
    Well, and how misleading is that result if the date formula was '<+CM>', for instance?
  • ta5ta5 Posts: 1,164Member
    Hi Vaprog
    Thank you for raising this topic.
    Good point indeed, but for my special requirement ok.
    Thomas
Sign In or Register to comment.