Jim,
I am using 14.1. I have tried so many different ways to format my dates and have not figured out the right format. Below is more of my code. I am passing a variable from a date box. My excel import Login Date looks like
Please take a look if I am passing the ALstartDT correctly and any recommendation on how to properly format the date to get the select to work.
Thank you,
Wayne
Clear Log();
Names Default to Here (1);
runScript = Expr(
TempstartDT = start << get;
TempendDT = end << get;
ALstartDT = Uppercase(Format(TempstartDT, "mm/dd/yyyy"));
ALendDT = Uppercase(Format(TempendDT, "mm/dd/yyyy"));
);
// 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", ButtonPressed = "Cancel"), ButtonBox("Get Data", ButtonPressed = "Get Data") //stores users button press input into variable
));
wait (15);
//If statements to take action based on which button was pressed on the date prompt
If ( ButtonPressed == "Cancel", nw << Close Window);
If ( ButtonPressed == "Cancel", Stop());
if ( ButtonPressed == "Get Data", runScript);
If ( ButtonPressed == "Get Data", runScript2);
If ( ButtonPressed == "Get Data", nw << Close Window);
Caption("Query is running");
wait(0);
Names Default to Here (1);
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 1 ),
Data Starts on Row( 2 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
);
);
//Column ("Login Date") << data type (numeric) << format("m/d/y");
dt6 << Select where (:Login Date >= ALstartDT,current selection("extend"));
dt7 << select where(Is Missing (:Label ID)) << delete rows;
selrows=dt7 << get rows where (:Formatted Entry == "ND");
dt7:Formatted Entry[selRows]="0";
dt7:Formatted Entry << data type(Numeric);