Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

kashaboinaraj
Contributor

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
josemanuel_cayo
New Contributor III

Re: 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';

MVP
MVP

Re: change date from DD/MM/YYYY TO 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 ...;

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

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
Honored Contributor II

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

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
MVP
MVP

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

Community Browser