cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
vickie_moser
Level I

Select where containing a date

I am trying to remove the rows in a column named date data ran in my script.

I have tried Select Where (Date Data Ran == 05/05/2014)

I have also tried Get Rows where (:Date Data Ran == 05/05/2014)

Along with about every option I can think of.

Any help would be appriciated.

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Select where containing a date

Haven't see the date function.  Is that something you wrote?  Anyway this will do what you want:

dt = New Table( "Sample Table",

     Add Rows( 4 ),

     New Column( "Date Data Ran",

           Numeric,

           Continuous,

           Format( "d/m/y", 12 ),

           Input Format( "d/m/y" ),

           Set Values( [3482092800, 3484771200, 3487363200, 3482092800] )

     )

);

search_date = informat("05/05/2014", "d/m/y");

del_rows = dt << get rows where(:Date Data Ran == search_date);

dt << delete rows(del_rows);

View solution in original post

3 REPLIES 3
jules
Community Manager Community Manager

Re: Select where containing a date

Hi Vickie,

Dates get a bit tricky in how they're stored. Unless the date column is a character column (so the dates are really just strings) you'll need to search for that date based on its epoch time. Here's a way to get JMP to do that for you:

dt = Current Data Table();

searchDate = date(05/05/2014);

dt<<Select Where(:Date Data Ran == searchDate);



I hope this helps!

Julian


EDIT: See PMroz's suggestion -- my code will only work with additional code to define the date() function I used.

pmroz
Super User

Re: Select where containing a date

Haven't see the date function.  Is that something you wrote?  Anyway this will do what you want:

dt = New Table( "Sample Table",

     Add Rows( 4 ),

     New Column( "Date Data Ran",

           Numeric,

           Continuous,

           Format( "d/m/y", 12 ),

           Input Format( "d/m/y" ),

           Set Values( [3482092800, 3484771200, 3487363200, 3482092800] )

     )

);

search_date = informat("05/05/2014", "d/m/y");

del_rows = dt << get rows where(:Date Data Ran == search_date);

dt << delete rows(del_rows);

jules
Community Manager Community Manager

Re: Select where containing a date

Oops-- thank you for catching that, PMroz! I use date() so often that I forgot it is a custom function I wrote to call informat with d/m/y. My apologies!  PMroz's method is perfect.

Julian

Recommended Articles