To set a formula
MyValue := '8D';
EVALUATE(MyDateFormula,MyValue);
or
EVALUATE(MyDateFormula,'8D');
To Return and use the DateFormula
MyValue := FORMAT(MyDateFormula);
MyDate := CALCDATE(MyValue,TODAY);
or
MyDate := CALCDATE(FORMAT(MyDateFormula),TODAY);
(Old thread - sorry)
Please always use '<8D>' when hardcoding dateformulas. Otherwise you code might fail or give incorrect results for users using a language where D isn't Days...
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MyValue := '8D';
EVALUATE(MyDateFormula,MyValue);
or
EVALUATE(MyDateFormula,'8D');
To Return and use the DateFormula
MyValue := FORMAT(MyDateFormula);
MyDate := CALCDATE(MyValue,TODAY);
or
MyDate := CALCDATE(FORMAT(MyDateFormula),TODAY);
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
Please always use '<8D>' when hardcoding dateformulas. Otherwise you code might fail or give incorrect results for users using a language where D isn't Days...
Peter