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

Date Format "2015-02-28T15:46:00"

Good afternoon,

How to change the date "2015-02-28T15:46:00" to "2015/02/28" in the script?

Regards

1 Solution

Accepted Solutions
sunny_talwar

How about this?

Date(Date#(Left(dt_cadastro, 10), 'YYYY-MM-DD'), 'DD/MM/YYYY') as DtCadastro_Cli,

View solution in original post

8 Replies
swuehl
MVP
MVP

Try

LOAD

    Date(Floor('2015-02-28T15:46:00'),'YYYY/MM/DD') as  Date,

     ...


resp.


Date(Floor(YourField),'YYYY/MM/DD') as Date

The format should be automatically interpreted by latest Qlik versions.

Roliba001
Contributor III
Contributor III
Author

Hi Stefan,

Didn't work

Date(Floor(dt_cadastro),'DD/MM/YYYY') as DtCadastro_Cli,

sunny_talwar

How about this?

Date(Date#(Left(dt_cadastro, 10), 'YYYY-MM-DD'), 'DD/MM/YYYY') as DtCadastro_Cli,

Roliba001
Contributor III
Contributor III
Author

Hi Sunny. many thanks.

It worked!

Qlikview is returning '01/01/1900" when the filed is empty. Is there a way to bring a blank field instead?

sunny_talwar

May be this

If(Date#(Left(dt_cadastro, 10), 'YYYY-MM-DD') > 10, Date(Date#(Left(dt_cadastro, 10), 'YYYY-MM-DD'), 'DD/MM/YYYY')) as DtCadastro_Cli,

Roliba001
Contributor III
Contributor III
Author

Many thanks again!

sunny_talwar

No problem

nsetty
Partner - Creator II
Partner - Creator II

Can you try below

DTTable:

Load * Inline [

DT

2015-02-28T15:46:00

];

DTFinal:

Load *, DATE(Timestamp#(DT, 'YYYY-MM-DDThh:mm:ss'), 'YYYY/MM/DD') AS NewDT

Resident DTTable;

Drop Table DTTable;