If you want a range of dates, then set up a table with a structure like
Sort N*
Name A10
StartDate D
EndDate D
Sort will keep things in the right order!
Name will be like Jan01, Feb01 etc.
StartDate will be 1.1.2001, 1.2.2001
EndDate will be 1.2.2001, 1.3.2001
(end is the first of the following month, so you do not have to remember the number of days in each month, look for less than this date).
then link in the query to this table with
Date in data table >=_start, <_end
and in the range table
StartDate = _start
EndDate = _date
You can then do you calc sum for many months in one go.
Phil