So the script that you have will result in a defined start date, "sdt", and a defined end date, "edt".
All you should need is a script to select rows in the table where the date is between sdt and edt.
Then subset the selected rows.
Take a look in the JMP Scripting Index. Help > Scripting Index. And look at the information and examples for Select Where and Subset.
Here is an example from the index for Select Where:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Diameter.jmp" );
dt << Process Screening(
Y( :DIAMETER ),
Grouping( :MACHINE, :Phase ),
Select Where( Alarm Rate > 0 )
);
Here is an example from the index for Subset.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Subset(
Rows(
[28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]
)
);
If you just want a script that will give you a subset table from the selected rows in a table, here is an example using the Big Class sample data set:
Data Table( "Big Class" ) << Subset(
Selected Rows( 1 ),
)
Open the Big Class data set from the sample data in JMP. Select some rows manually. Then run this script and see what happens.
Hopefully all this helps.
Regards,
Phil