cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMPĀ® Marketplace
Choose Language Hide Translation Bar
mallen810
Level III

Format Date Column

I am importing some sql data and it is bringing in the dates as data type Character and nominal model type (2017-11-01) and I am having an issue changing it to a workable date format such as (11/1/17). How do I reformat to this date type? I am attaching the data table for your review.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Format Date Column

Here is how to easily do what you want

1. Right click on the column header for pack_date and select Column  Info

2. In the Column Info window, change the Data Type from Character to Numeric

3. Click on the down arrow for the format and go to Date and select "m/d/y"

4. Click on the down arrow for the Input Format and go to Date and select "y/m/d"

5. Click on OK

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: Format Date Column

Here is how to easily do what you want

1. Right click on the column header for pack_date and select Column  Info

2. In the Column Info window, change the Data Type from Character to Numeric

3. Click on the down arrow for the format and go to Date and select "m/d/y"

4. Click on the down arrow for the Input Format and go to Date and select "y/m/d"

5. Click on OK

Jim
mallen810
Level III

Re: Format Date Column

Thanks for the quick response, worked perfectly.

Larry_Wang
Level I

Re: Format Date Column

how to copy the column property to into a script, I did exactly copy paste the script, but when I run the script, this pasted script doesn't work.

txnelson
Super User

Re: Format Date Column

Here is the JSL

names default to here(1);
dt=current data table();

:pack_date << data type(numeric)<<informat("y/d/d")<<format("m/d/y");

and this is the JSL that JMP generated when I did the conversion interactively

names default to here(1);
// Change column info: pack_date
Data Table( "BallMillHistory" ):pack_date <<
Set Data Type(
	Numeric,
	Format( "y/m/d", 10 ),
	Input Format( "y/m/d" ),
	Format( "m/d/y", 12 )
) << Set Modeling Type( "None" );

 

Jim