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

Change date format?

How do I change the date format? 

 

Current:  2010-04-01  00:00.00.00 plus even more zeros

Desired: 4-1-2010

 

Example script: 

Frog, 

Toad, 

Date, 

Country

 

 

Thank you. 

Labels (1)
6 Replies
SchalkF
Contributor III
Contributor III

Hi,

Try this:

Date(Date, 'mm-dd-yyyy')

Kind regards

Mark_Little
Luminary
Luminary

Hi

either change it on the main tab or wrap the DATE() Function around the data

DATE(Date,"MM-DD-YYYY") as Date

Breezy
Creator II
Creator II
Author

Oh peculiar. It's not working. I must still be doing something wrong. Ok, I'm changing the name of date and placement for this example. Maybe that will help you figure it out? Or maybe it won't make a difference and I just can't get it to work.  

 

Example script: 

Frog, 

Toad, 

Lisa_Date

WHERE

 

The following two attempts do not work:

Attempt 1:

Lisa_Date(Date,'MM-DD-YYYY') 

Attempt 2: 

Lisa_Date(Date,"MM-DD-YYYY") as Lisa_Date

 

SchalkF
Contributor III
Contributor III

Hi,

You should put Lisa_Date inside and not outside, like below:

Date(Lisa_Date,"MM-DD-YYYY") as Lisa_Date

Kind regards

Breezy
Creator II
Creator II
Author

Thanks for the clarification. I'll give it a try!

MarcoWedel

maybe like this?

 

table1:
LOAD *,
     Date(Date#(SubField(Current,' ',1),'YYYY-MM-DD'),'M-D-YYYY') as Desired
Inline [
Current
2010-04-01  00:00.00.00
2010-04-02  00:00.00.000
2010-05-01  00:00.00.0000
2010-05-02  00:00.00.00000
2010-06-01  00:00.00.000000
2010-06-02  00:00.00.0000000
];

 

MarcoWedel_0-1662494216863.png

 

 

hope this helps

Marco