Add a new window for Start & End Calendar date selection box/ date entry boxHi JMP community, I usually use jmp preselected and plot graphs need a help to add selection date amend for my script below.
As per below, once I call out database, I have to amend the dates for start & end in order to query needed data on input dates.
dt = Open Database(
"DSN=xxx ;Description=yyy;UID=zzz;PWD=zzz;APP=JMP;DATABASE=MATS;",
"SELECT pen_parametric.pn_id, pen_parametric.equiplk_ky, parametric_dlk.paramlk_ky,
FROM MATS.parametric_dlk parametric_dlk, MATS.pen_parametric pen_parametric
WHERE parametric_dlk.paramlk_ky = parametric_ref_llk.paramlk_ky AND parametric_dlk.paramlk_ky = pen_parametric.paramlk_ky AND ((pen_parametric.part_dm Between {ts '2019-07-01 00:00:00'} And {ts '2019-07-02 00:00:00'}))"
);
dt << Set Name( "Data01" );
So, for (Between {ts '2019-07-01 00:00:00'} And {ts '2019-07-02 00:00:00'})
Is it possible for adding a script box that prompt up new window calendar box for selection of the calendar as per formatted date above so can replace the date to the ones i want/select and then run the script?
Thank you in advance!
BR, Otis
Re: Add a new window for Start & End Calendar date selection box/ date entry boxDan, @danschikore , thank you.
I too like the date formatted NumberEditBox(). I was going to post an alternate script that produces the dialog shown below. However, I thought @OtisZeca might be new to JSL. Very useful options of the NumberEditbox() includes, setting a minimum, a maximum and specifying integer only. The attached script uses a function to create a bounded integer number edit box that returns the value to a user specified variable, which is vauable for non-Modal dialogs. I am posting it for the blog, since I know you don't need an example.

Re: Add a new window for Start & End Calendar date selection box/ date entry boxHere's a modified version of Georgia's script that uses Number Edit Box instead of directly using the Calendar Box. Number Edit Box has a popup version of the calendar build-in if the numeric format is set to a date. I set the format to only include the day, but you can include time-of-day as well if you need that level of granularity.

Names Default To Here( 1 );
tmpstr =
"SELECT pen_parametric.pn_id, pen_parametric.equiplk_ky, parametric_dlk.paramlk_ky,
FROM MATS.parametric_dlk parametric_dlk, MATS.pen_parametric pen_parametric
WHERE parametric_dlk.paramlk_ky = parametric_ref_llk.paramlk_ky
AND parametric_dlk.paramlk_ky = pen_parametric.paramlk_ky
AND ((pen_parametric.part_dm Between {ts '^sdt^'} And {ts '^edt^'}))";
New Window( "Query Date",
<<MODAL></MODAL>Re: Add a new window for Start & End Calendar date selection box/ date entry boxahh icic.. thanks for your help!
need more practice understanding what you've written. thank you!
Re: Add a new window for Start & End Calendar date selection box/ date entry box@OtisZeca,
There are multiple methods to do this. Here is one example

Names Default To Here( 1 );
tmpstr = "SELECT pen_parametric.pn_id, pen_parametric.equiplk_ky, parametric_dlk.paramlk_ky,
FROM MATS.parametric_dlk parametric_dlk, MATS.pen_parametric pen_parametric
WHERE parametric_dlk.paramlk_ky = parametric_ref_llk.paramlk_ky
AND parametric_dlk.paramlk_ky = pen_parametric.paramlk_ky
AND ((pen_parametric.part_dm Between {ts '^sdt^'} And {ts '^edt^'}))"
;
New Window( "Query Date", <<MODAL></MODAL>