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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time Field

I want to format a date field as it is being outputted as a string eg - 20112112

I need this to be  21-12-2011

Ive tried date(DoB,'dd-mm-yyyy') as DoB   - this is outputting strings like '01-00-55345'

Ive also tried to split out the string using mid, left, right and then concatenating, this doesnt work either

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

date(date#(DoB,'YYYYDDMM'),'DD-MM-YYYY') as DoB

Date() is just a formatting function.  Date#() is how you read data from input to create a date field.  Used together like the above, one must use the format of the input, and the other the format of the desired output.

View solution in original post

1 Reply
johnw
Champion III
Champion III

date(date#(DoB,'YYYYDDMM'),'DD-MM-YYYY') as DoB

Date() is just a formatting function.  Date#() is how you read data from input to create a date field.  Used together like the above, one must use the format of the input, and the other the format of the desired output.