CALCDATE

Hello All I have created a variable that will hold an integer value. I want to use the value stored in this variable to calculate a date. i.e. exampledate := CALCDATE(’+4D’, WORKDATE); This will give me 4 days from now. I want to substitute ‘+4D’ with the number of days in my variable. Ideas? Thanks again

exampledate := CALCDATE(STRSUBSTNO(’<+%1D>’,intvar),WORKDATE);

ExampleDate := WORKDATE + MyIntegerVariable also does the trick, if I remember correctly.

Note that if you use multi language you need to write the date expression between < >, otherwise you’ll get the error message: 4D is not a valid date expression… Fun if you don’t know.µ [:p] Regards, John

Hi, i am also doing it this way in our Application Server for counting up time. Maybe you can adapt it to your needs: NewTime := OldTime + (1000*60*60) ← this increases time variable by 1 hour

quote:


Originally posted by nelson
ExampleDate := WORKDATE + MyIntegerVariable also does the trick, if I remember correctly.


Yes, this works. The integer always represents days.