Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
how to change date from DD/MM/YYYY TO DD-MM-YYYY
Hi,
in your editor change:
SET DateFormat='DD/MM/YYYY';
by
SET DateFormat='DD-MM-YYYY';
Just use Date#() interpretation function and Date() formatting function accordingly:
LOAD
Date(Date#(DateField, 'DD/MM/YYYY'), 'DD-MM-YYYY') as DateField,
...
FROM ...;
or an alternative could be (using Stefan's code):
SET DateFormat='DD-MM-YYYY';
LOAD
Date(Date#(DateField, 'DD/MM/YYYY')) as DateField,
...
FROM ...;
here you won't need to specify the format for the Date() function as you have already done that at the very beginning of the script using the SET statement.
Hi Vishnu,
Try like this:
Date(Date#(Yourfield, 'DD/MM/YYYY'), 'DD-MM-YYYY') as DateField
or simply
Date(Yourfield,'DD-MM-YYYY') as DateField
Regards
KC