Hello,
I used to use a jmp script to extract sql data table. This day I tried to built a window panel box to execute the same sql data table function.
The simple idea is to extract sql data table within a period of time, which would be two input variables in the panel box. The "End_Time" can easily use Today() syntax. However, for "Start_Time", I tried to write a script that allow user to input a certain "hour "before End_time that he want to pull the data table.
Unfortunately, this script is not working as expected.
Can any jmp script guru try to correct my script below? I also attached the jmp script I wrote for modification.
Many Thanks,
nw = new window("SQL Data Table Extraction",
Vlistbox(
tb1=textbox("Start_Time: "),
dteb1 = numbereditbox(1),
hlistbox(
text box("Enter the number of hours: "),
hours_teb = text edit box()),
tb2=textbox("End_Time: "),
dteb2 = numbereditbox(1),
),
ok_button = button box("Get Data", << Open Database("DSN=;Description=;UID=;PWD=;APP=;WSID=", sql_statement, Test Data)),
dteb1 << set format(format("m/d/y h:m:s", 23, 0)),
dteb1 << set width(23),
dteb1 << set(today()-EvalExpr((hours_tab)*60*60)),
dteb2 << set format(format("m/d/y h:m:s", 23, 0)),
dteb2 << set(Today()));
sql_statement="SELECT * FROM dbo.TESTCOMPLETE WHERE (dCreated >= '"||Start Date/Time||"') AND (dCreated <='"||End_Date/Time||"')");