I am constantly needing to convert Date:Time columns (M/D/Y hh:mm:ss) to date columns and am looking for a script I can add in as a tool such that I can select the Date:Time column I am wanting to use (regardless of the name of the column) to make a new date column and have the script saved into an easy to access shortcut.
The part I am not able to figure out is how I can reference a "selected column" in the new column formula... I feel it should be along the lines of what I have below, except in the formula I am not currently able to figure out how to reference the selected column.
dt1 = Current Data Table();
sc1 = dt1 << Get Selected Columns;
dt1<
In my current data table the Date:Time column is named DviStartTime and is in the format (m/d/y hh:mm:ss), I want to add a new column named date without having to specify the exact name of the column.
Any help is appreciated!
Jocelyn
You need to use the As Column() function, or in some cases the Column() function to be able to reference the columns with memory variables. See below:
dt1 = Current Data Table();
sc1 = dt1 << Get Selected Columns;
dt1<<NEW column=""></NEW>