Hi Vince,
Thanks for guiding through my blind points and getting me closer. However, even after changing startDT = MDYHMS(start<< get) format I still cannot get this sql script working. Then, I am still receiving the same jmp warning message "Name Unresolved:Runscript in scces or evaluation of 'RunScirpt, RunScript/*###*/". Is there anything wrong in my script?
I also attached my script for checking.
Thanks for your help!
NamesDefaultToHere(1);
// Written by Vince Faller
// Makes a calendar come up on a numeditbox (defaults to now)
// Note, this only works on JMP 11 or above
dateBox = Function(
{timething = Today()},
{newbox},
newbox = Eval(
Substitute(
Name Expr(
Number Edit Box(
timething, // Eval(Sub()) because of JMP quirk
10, // Just need this because JMP doesn't default a width
<<Set function(
Function( {self},
{},
If( Is Missing( self << get ),
self << Set( Eval( DUMMY ) ) // Sets the date to the timething argument
)
)
),
<< Set Format( Format( "m/d/y h:m:s", 23, 0 ) ); // Makes datetime format for the box (gives calendar)
)
),
Expr( DUMMY ), timething
)
);
newbox;
);
nw =
New Window( "SQL Data Table Extraction",
LineUpBox(NCol(2),
TextBox("Start DateTime"), start = dateBox(Today() - InDays(12)),
TextBox("End DateTime"), end = dateBox(),
ButtonBox("Cancel", nw << close window), ButtonBox("Get Data", RunScript)
));
sql_statement=evalinsert("SELECT * FROM dbo.TESTCOMPLETE WHERE dCreated >= '^start_time^' AND dCreated <= '^end_time^' ORDER BY dCreated");
RunScript= Expr(nw<<Close Window;
startDT=MDYHMS(start << get);
endDT=MDYHMS(end<<get);
Open Database(
"DSN=;Description=;UID=;PWD=;APP=;WSID=",
sql_statement,"Test Result"));