Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert 30112010 to dd-mm-yyyy

Hi,

I have a list of dates like the following, how can i turn them to DD-MM-YYYY ?

8112010

9112010

10112010

11112010

1 Solution

Accepted Solutions
googel84
Partner - Creator III
Partner - Creator III

Try with

date(date#(<your date>,'DMMYYYY'),'DD-MM-YYYY')

View solution in original post

7 Replies
renjithpl
Specialist
Specialist

Hi,

try this

Date(Datefield, 'DD-MM-YYYY') as Date

Regards

REnjith

googel84
Partner - Creator III
Partner - Creator III

Try with

date(date#(<your date>,'DMMYYYY'),'DD-MM-YYYY')

Not applicable
Author

Try as follows....



DATE(MAKEDATE(LEFT(DateFeild,2),MID(DateFeild,3,2),RIGHT(DateFeild,4))) as NEW_DATE






Not applicable
Author

Thanks for the suggestions. BUT, the problem i have here is the date is not full 8 digits

some are 7 some are 8. thats the problem...

Not applicable
Author

Actual Answer:

if(len( Start_Date )='7', date(date#(Start_Date,'DMMYYYY'),'DD-MM-YYYY'), date(date#(Start_Date,'DDMMYYYY'),'DD-MM-YYYY') )

Not applicable
Author

MMmmmm that's the problem..

Guess this will work .. Just try and see ( I didn't try )


If left(DateFeild,2)<=12,DATE(MAKEDATE(LEFT(DateFeild,2),MID(DateFeild,3,2),RIGHT(DateFeild,4))),DATE(MAKEDATE(LEFT(DateFeild,1),MID(DateFeild,3,2),RIGHT(DateFeild,4)))) as NEW_DATE


googel84
Partner - Creator III
Partner - Creator III

Sorry nicksatch for the misunderstanding on string length.

I would suggest you an easier way to manage it.