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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
oseimuduame
Creator II
Creator II

Converting DateTime to Date

Good Morning all,

     i have a Bottle-Neck that i am struggling with, i have a CreatedDateTime which i want to convert to just Date.

     i used    TO_CHAR(o.CreatedDateTime, DD-MM-YYYY) which is not working.

     please i need help on this.

Thank You.

15 Replies
oseimuduame
Creator II
Creator II
Author

@Toni Kautto its is not advice on how to compose my SQL Query. i have a functioning Date that i Format from Oracle Database Using TO_CHAR. But i dont know why all what i have tried is not working for this one.

i have tried CAST, I have also Tried CONVERT

ToniKautto
Employee
Employee

You are still referring to SQL functions. There is no CAST or CONVERT in Qlik engine. For this reason you are asking for help to compose a SQL query, and are not asking about help with Qlik functionality.

Anything that you define after the SQL keyword will be sent and processed by the connector or data source. The Qlik engine will not process this string.

If you filed is properly formatted in the database, why do you not just load it as it is and format it in QlikView? If you load the data without converting it in SQL statement, what value do you get?

oseimuduame
Creator II
Creator II
Author

Ohh i get your point now @Toni The Value i am getting is 2016-08-22 10:54:23 365 which is not what i want.

i want to Format it in Qlikview to be like 2016-08-22

So that i can work with it in QLIKVIEW

rupamjyotidas
Specialist
Specialist

What the above suggestions are saying is that you run the script like this

Load

*

Date(Floor(ORDER_DATE),'YYYY-MM-DD') as OrderDate;

SELECT

  i.GroupCode as "ITEM_GROUP",

  o.MenuItemName as "MENU_ITEM_NAME",

o.CreatedDateTime as "ORDER_DATE",

    o.Price as "MENU_ITEM_PRICE",

  o.Quantity as "MENU_ITEM_QTY"

FROM DashAlata.dbo.MenuItems i, DashAlata.dbo.Orders o

WHERE i.Id = o.MenuItemId;

For more info please ready about preceding load.

ToniKautto
Employee
Employee

Try loading it as the unwanted text, and format the value in the LOAD statement.Perhaps try something in line with...

LOAD

     Date(Date#(ORDER_DATE, 'YYYY-MM-DD hh:mm:ss fff')) AS ORDER_DATE

;

SQL SELECT

o.CreatedDateTime as "ORDER_DATE"

FROM DashAlata.dbo.Orders o;


oseimuduame
Creator II
Creator II
Author

Hello Guys, thank you for your Support. My dashboard working perfectly i just need to Join my Table Correctly

i always say this, You guys are the Best and this Community is the Best i have ever joined. Keep it up guys

Working Perfectly