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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Converting SQL Date Format

I have a date field which I am pulling in via SQL script as follows:

   TO_CHAR(A.ACTUAL_OPEN_EST_TIME, 'DD MON YY HH24:MI:SS')  As "Change Actual Open Time",

Above my SQL code, I'm attempting to convert this to a useable date format using the following code:

Date(Date#(Left([Change Actual Open Time], 10), 'MM/DD/YYYY'), 'MM/DD/YY') as ChangeOpenDate

I'm getting all blank values.. not sure what I'm doing wrong here.

13 Replies
varshavig12
Specialist
Specialist

Input:         05 JUN 14 14:49:47 or DD MON YY hh24:min:ss

The desired format is MM/DD/YY

Output:



try this:

=Date(Timestamp(Timestamp#('05 JUN 14 14:49:47','DD MMM YY hh:mm:ss'),'DD/MMM/YY hh:mm:ss tt'),'MM/DD/YY')

Not applicable
Author

Varsha-- this actually worked to convert the format, but appears to be only hiding the timestamp.  I can tell because when I create a list box I have a ton of duplicate dates..

Thanks

Not applicable
Author

Input from SQL:

05 JUN 14 14:49:47 OR DD MON YY hh24:min:ss

Desired Output:

6/5/14 OR MM/DD/YY

Not applicable
Author

this one worked.. thanks!