Here is a script that takes the start and stop date and produces records for each month for each value of the things from the data table.
Names Default To Here( 1 );
New Window( "Set Date Range for Data Merge",
<<Modal,
sd = Date Increment( Today(), "year", -2, "start" );
ed = Today();
H List Box(
Text Box( "From:" ),
scal = Number Edit Box(
sd,
<<Set Format( Format( "m/y" ) ),
<<SetFunction( Function( {this}, sd = scal << Get ) ),
<<Set Show Spin Box( 1 )
),
Spacer Box( Size( 20, 20 ) ),
Text Box( "To:" ),
ecal = Number Edit Box(
ed,
<<Set Format( Format( "m/y" ) ),
<<SetFunction( Function( {this}, ed = ecal << Get ) ),
<<Set Show Spin Box( 1 )
),
);
);
dt = Current Data Table(); // Point to the table with the list of Things
things = dt:Thing << get values;
numbMonths = Date Difference( sd, ed, "month" );
dtNew = New Table( "Output",
New Column( "Thing" ),
New Column( "Month-Year", Format( "m/y", 7 ) ),
add rows( N Items( things ) * numbMonths )
);
theDay = Day( sd );
theMonth = Month( sd );
theYear = Year( sd );
theRow = 0;
For( monthCNT = 1, monthCNT <= numbMonths, monthCNT++,
For( thingCNT = 1, thingCNT <= N Items( things ), thingCNT++,
theRow++;
:Thing[theRow] = things[thingCNT];
:Name( "Month-Year" )[theRow] = Date MDY( theMonth, theDay, theYear );
);
If( theMonth < 12,
theMonth = theMonth + 1,
theMonth = 1;
theYear = theYear + 1;
);
);
Jim