<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add a new window for Start &amp;amp; End Calendar date selection box/ date entry box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216850#M43329</link>
    <description>&lt;P&gt;ahh icic.. thanks for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;need more practice understanding what you've written. thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 02:46:21 GMT</pubDate>
    <dc:creator>OtisZeca</dc:creator>
    <dc:date>2019-07-10T02:46:21Z</dc:date>
    <item>
      <title>Add a new window for Start &amp; End Calendar date selection box/ date entry box</title>
      <link>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216467#M43254</link>
      <description>&lt;P&gt;Hi JMP community, I usually use jmp preselected and plot graphs need a help to add selection date amend for my script below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per below, once I call out database, I have to amend the dates for start &amp;amp; end in order to query needed data on input dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; Set Name( "Data01" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for&amp;nbsp;&lt;STRONG&gt;(Between {ts '&lt;FONT color="#0000FF"&gt;&lt;EM&gt;2019-07-01 00:00:00&lt;/EM&gt;&lt;/FONT&gt;'} And {ts '&lt;FONT color="#99CC00"&gt;&lt;EM&gt;2019-07-02 00:00:00&lt;/EM&gt;&lt;/FONT&gt;'})&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;BR, Otis&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 12:06:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216467#M43254</guid>
      <dc:creator>OtisZeca</dc:creator>
      <dc:date>2019-07-08T12:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Add a new window for Start &amp; End Calendar date selection box/ date entry box</title>
      <link>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216479#M43257</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/15309"&gt;@OtisZeca&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are multiple methods to do this. Here is one example&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 663px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18199iA9E30F992F39B5C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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", &amp;lt;&amp;lt;Modal,

sd=Today();
ed=Today();
 HListBox(
    PanelBox( "From Time",
      scal = Calendar Box(, SetFunction(Function({this}, sd=scal&amp;lt;&amp;lt; Get Date) ))
    ),
    spacerbox(Size(20,20)),
    PanelBox( "To Time",
    ecal = Calendar Box(, SetFunction(Function({this}, ed=ecal&amp;lt;&amp;lt; Get Date) ))
    )
));

sdt = Munger(Format Date(sd, "yyyy-mm-ddThh:mm:ss"), 1, "T", " "); 
edt = Munger(Format Date(ed, "yyyy-mm-ddThh:mm:ss"), 1, "T", " "); 


show(sdt, edt);
 
qstring = EvalInsert(tmpstr);
show(qstring);  //see log

//then run the line below
//dt = Open Database("DSN=xxx ;Description=yyy;UID=zzz;PWD=zzz;APP=JMP;DATABASE=MATS;", qstring);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 11:32:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216479#M43257</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-07-08T11:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add a new window for Start &amp; End Calendar date selection box/ date entry box</title>
      <link>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216850#M43329</link>
      <description>&lt;P&gt;ahh icic.. thanks for your help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;need more practice understanding what you've written. thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 02:46:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216850#M43329</guid>
      <dc:creator>OtisZeca</dc:creator>
      <dc:date>2019-07-10T02:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add a new window for Start &amp; End Calendar date selection box/ date entry box</title>
      <link>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216890#M43339</link>
      <description>&lt;P&gt;Here's a modified version of Georgia's script that uses Number Edit Box instead of directly using the Calendar Box.&amp;nbsp; Number Edit Box has a popup version of the calendar build-in if the numeric format is set to a date.&amp;nbsp; 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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="NumEditCalendar.png" style="width: 309px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18268i834A3461698D653E/image-size/large?v=v2&amp;amp;px=999" role="button" title="NumEditCalendar.png" alt="NumEditCalendar.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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",
	&amp;lt;&amp;lt;Modal, 
	sd = Today();
	ed = Today();
	H List Box(
		Text Box( "From:" ),
		scal = Number Edit Box( sd, &amp;lt;&amp;lt;Set Format( Format( "yyyy-mm-dd" ) ), &amp;lt;&amp;lt;SetFunction( Function( {this}, sd = scal &amp;lt;&amp;lt; Get ) ), &amp;lt;&amp;lt;Set Show Spin Box(1) ),
		Spacer Box( Size( 20, 20 ) ),
		Text Box( "To:" ),
		ecal = Number Edit Box( ed, &amp;lt;&amp;lt;Set Format( Format( "yyyy-mm-dd" ) ), &amp;lt;&amp;lt;SetFunction( Function( {this}, ed = ecal &amp;lt;&amp;lt; Get ) ), &amp;lt;&amp;lt;Set Show Spin Box(1) ),
	);
);

sdt = Munger( Format Date( sd, "yyyy-mm-ddThh:mm:ss" ), 1, "T", " " );
edt = Munger( Format Date( ed, "yyyy-mm-ddThh:mm:ss" ), 1, "T", " " ); 


Show( sdt, edt );
 
qstring = Eval Insert( tmpstr );
Show( qstring );  //see log
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 13:24:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216890#M43339</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2019-07-10T13:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add a new window for Start &amp; End Calendar date selection box/ date entry box</title>
      <link>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216986#M43356</link>
      <description>&lt;P&gt;Dan, &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp;, thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I too like the date formatted NumberEditBox(). I was going to post an alternate script that produces the dialog shown below. However, I thought&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/15309"&gt;@OtisZeca&lt;/a&gt;&amp;nbsp;might be new to JSL.&amp;nbsp; Very useful options of the NumberEditbox() includes, setting a minimum, a maximum and specifying integer only.&amp;nbsp; 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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 612px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18271iA02BC9F1B69317FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 19:02:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-a-new-window-for-Start-amp-End-Calendar-date-selection-box/m-p/216986#M43356</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-07-10T19:02:34Z</dc:date>
    </item>
  </channel>
</rss>

