Convert Dates.jsl (Script for Converting Character Dates to Numeric Dates) creates a data table, specifies the data input format, changes the column to a numeric continuous column, and applies the m/d/y format (Converting Character Dates (Before and After)).
Script for Converting Character Dates to Numeric Dates
Converting Character Dates (Before and After)
When you change the column’s data type from character to numeric, defining the format in which the data were entered is important. In this example, Informat( "d/m/y" ) defines the input format. Format( "m/d/y" ) defines the new display format. If Informat() is omitted, the Format() value is applied as both the input and display format. This results in missing values for some data.
Modify Convert Dates.jsl to see for yourself.
1.
Open Convert Dates.jsl from the sample scripts folder.
4.
On line 27, delete Informat( "d/m/y" ), (including the comma).
Format( "m/d/y" ) is applied to the column. Only "01/25/2010" appears in the column. The other values are missing; "30/09/2009" and "15/12/2013" are not valid m/d/y values.