%1 Enter the column to total:
%2 Enter the table that contains the column:
%3 Enter the column that contains the date:
%template
CLEAR VARIABLE date1
CLEAR VARIABLE date2
CLEAR VARIABLE datrange
CLS
FILLIN date1 USING "Enter start date: " AT 10,15
FILLIN date2 USING "Enter end date or [ENTER] for today: " AT 11,15
IF date2 FAILS THEN
   SET VARIABLE date2 to .#DATE
   SHOW VARIABLE date2 AT 11,52
ENDIF
COMPUTE datrange AS SUM %1 FROM %2 WHERE %3 GE .date1 +
AND %3 LE .date2
WRITE "Total for this time period: " AT 13,15
SHOW VAR datrange AT 13,43
WRITE "Press any key to continue" at 15,15
PAUSE
 
