Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Under <Order Date> field , there are 2 types of date format in one column
a) one format : DD - MM - YYYY
b) another format : MM / DD / YYYY
How can I change these 2 different formats into required format i.e. DD/ MM / YYYY ?
Please help me with the script part.
| Order Date | Region | Rep | Item | Units | Unit Cost | Total |
| 01-06-2019 | East | Jones | Pencil | 95 | 1.99 | 189.05 |
| 1/23/2019 | Central | Kivell | Binder | 50 | 19.99 | 999.5 |
| 02-09-2019 | Central | Jardine | Pencil | 36 | 4.99 | 179.64 |
| 2/26/2019 | Central | Gill | Pen | 27 | 19.99 | 539.73 |
| 3/15/2019 | West | Sorvino | Pencil | 56 | 2.99 | 167.44 |
| 04-01-2019 | East | Jones | Binder | 60 | 4.99 | 299.4 |
| 4/18/2019 | Central | Andrews | Pencil | 75 | 1.99 | 149.25 |
| 05-05-2019 | Central | Jardine | Pencil | 90 | 4.99 | 449.1 |
| 5/22/2019 | West | Thompson | Pencil | 32 | 1.99 | 63.68 |
| 06-08-2019 | East | Jones | Binder | 60 | 8.99 | 539.4 |
| 6/25/2019 | Central | Morgan | Pencil | 90 | 4.99 | 449.1 |
| 07-12-2019 | East | Howard | Binder | 29 | 1.99 | 57.71 |
| 7/29/2019 | East | Parent | Binder | 81 | 19.99 | 1,619.19 |
| 8/15/2019 | East | Jones | Pencil | 35 | 4.99 | 174.65 |
| 09-01-2019 | Central | Smith | Desk | 2 | 125 | 250 |
| 9/18/2019 | East | Jones | Pen Set | 16 | 15.99 | 255.84 |
| 10-05-2019 | Central | Morgan | Binder | 28 | 8.99 | 251.72 |
| 10/22/2019 | East | Jones | Pen | 64 | 8.99 | 575.36 |
| 11-08-2019 | East | Parent | Pen | 15 | 19.99 | 299.85 |
| 11/25/2019 | Central | Kivell | Pen Set | 96 | 4.99 | 479.04 |
| 12-12-2019 | Central | Smith | Pencil | 67 | 1.29 | 86.43 |
| 12/29/2019 | East | Parent | Pen Set | 74 | 15.99 | 1,183.26 |
| 1/15/2020 | Central | Gill | Binder | 46 | 8.99 | 413.54 |
| 02-01-2020 | Central | Smith | Binder | 87 | 15 | 1,305.00 |
| 2/18/2020 | East | Jones | Binder | 4 | 4.99 | 19.96 |
| 03-07-2020 | West | Sorvino | Binder | 7 | 19.99 | 139.93 |
| 3/24/2020 | Central | Jardine | Pen Set | 50 | 4.99 | 249.5 |
| 04-10-2020 | Central | Andrews | Pencil | 66 | 1.99 | 131.34 |
| 4/27/2020 | East | Howard | Pen | 96 | 4.99 | 479.04 |
| 5/14/2020 | Central | Gill | Pencil | 53 | 1.29 | 68.37 |
use below conversion in script editor for Order Date:
Date(Floor(Alt(Num(DateField), Num(Date#(DateField, 'DD-MM-YYYY')), Num(Date#(DateField, 'D/M/YYYY')))), 'DD/MM/YYYY') as NewDateField
use below conversion in script editor for Order Date:
Date(Floor(Alt(Num(DateField), Num(Date#(DateField, 'DD-MM-YYYY')), Num(Date#(DateField, 'D/M/YYYY')))), 'DD/MM/YYYY') as NewDateField
thank you for providing this solution it really help me to solve my date problem.
@anat Can you please explain how this works?
pls go through the below Alt function explanation
I have two date format DD-MM-YYYY and DD/MM/YYYY in one column above script change only one format like DD-MM-YYYY?
@anat Thank you so much!