$ 0 0 Change your code as like below like PeriodLength := '-2d'; SDate := CALCDATE(PeriodLength, "Posting Date");