Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

String to hh:mm

Hello Friends,

We are storing time in our sql database as a string eg 0715. How can I change it to the correct format to read it as 07:15?

I tried the below but none formatted it right.

Time(Time#(TimeColumn,'hhmmTT'),'hh:mm')

Or

Time(Time#(Mid(TimeColumn,1,4),'hh:mm'))

In addition, please also explain where I need to enter the expression or the formatting code since I am new to the QlikView.

Thank you.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Load

     *,

     Time(Time#(TimeColumn,'hhmm'),'hh:mm') as TimeColumnNew;

SQL SELECT

     Field1,

     Field2,

     TimeColumn,

     Field4

From BlahBlah;

View solution in original post

3 Replies
MK_QSL
MVP
MVP

Load

     *,

     Time(Time#(TimeColumn,'hhmm'),'hh:mm') as TimeColumnNew;

SQL SELECT

     Field1,

     Field2,

     TimeColumn,

     Field4

From BlahBlah;

Anonymous
Not applicable
Author

It worked. I wasn't including the alias and didn't do proper selection in Load and Select.

I get the structure now. Thank you.

Anonymous
Not applicable
Author

This formatted time looks fine when I have CustomerID in a separate List Box and formatted time field in a separate List Box. However, when I try to see CustomerID and this formatted time field together in a Table Box, all the times get displayed as 00:00. Can you please help so that all the CustomerID displays all the correct times in Table Box instead of 00:00?