Integer to code

JAKAJAKA Member Posts: 18
Hello and sorry if my question is stupid, just novice...

This works fine:
IF CALCDATE(<+18Y>,Birthdate) > TODAY THEN
  Child := TRUE
ELSE
  Child := FALSE;
But, I want to use field from another table as a variable:
SRSetup.RESET;
IF SRSetup.FINDSET THEN BEGIN
   ChildStr := '<+' + SRSetup.ChildAge + 'Y>';
   //MESSAGE('Age: %1',ChildStr);
END;

IF CALCDATE(ChildStr,Birthdate) > TODAY THEN
  Child := TRUE
ELSE
  Child := FALSE;
NAV complains Integer + String error.

Could you help me with this?

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    ChildStr := '<+' + FORMAT(SRSetup.ChildAge) + 'Y>';
    
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • JAKAJAKA Member Posts: 18
    Thank you very much, that was almost too easy!
Sign In or Register to comment.