Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kashaboinaraj
Creator
Creator

change date from DD/MM/YYYY TO DD-MM-YYYY

Hi

how to change date from DD/MM/YYYY TO DD-MM-YYYY

5 Replies
Anonymous
Not applicable

Hi,

in your editor change:

SET DateFormat='DD/MM/YYYY';

by

SET DateFormat='DD-MM-YYYY';

swuehl
MVP
MVP

Just use Date#() interpretation function and Date() formatting function accordingly:

LOAD

     Date(Date#(DateField, 'DD/MM/YYYY'), 'DD-MM-YYYY') as DateField,

     ...

FROM ...;

sunny_talwar

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.

jyothish8807
Master II
Master II

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

Best Regards,
KC
swuehl
MVP
MVP