Hello,
I started a script that imports multiple excel files into one table. The date field has a mix of formats; mm/dd/yyyy , mm.dd.yy and mm-dd-yy.
I tried using recode, and looking at the script it looks like static values:
Current Data Table() << Begin Data Update;<BR />dc1 = New Column( :Date );<BR />dc1 << Set Name( "Date 3" );<BR />Current Data Table() << Go to( dc1 );<BR />Current Data Table() << Move Selected Columns( after( :Date ) );<BR />For Each Row(<BR /> dc1[] = Match( :Date,<BR /> "10.11.18", "10/11/18",<BR /> "10.16.18", "10/16/18",<BR /> "10.20.18", "10/20/18",<BR /> "10.21.18", "10/21/18",<BR /> "10.24.18", "10/24/18",<BR /> "11-01-18 A1", "11/01/18 A1",<BR /> "11.08.18", "11/08/18",<BR /> :Date<BR /> )<BR />);<BR />Current Data Table() << End Data Update;<BR />
Essentially what I'm looking for as my end result is having all the dates formatted in a short date format, mm/dd/yy.
I need help making this code work for any new values that may be added later or maybe there is a better way to do it?
This is a common issue for users. A search of previous discussions will find a few solutions that might suit you. Here is one discussion from which you can adapt an answer.