Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change DateTime to Time

Hi, I'm newish to QV

I've loaded in data via Sql 2008 and QVD files.  One column has the datetime data type (im not allowed to change anything in the SQL DWH) i need to change it ro just Date in the QV.

What's the best and easiest way to do this.

Thanking you guys in advance.

1 Solution

Accepted Solutions
er_mohit
Master II
Master II

date(Datetime,'DD-MM-YYYY') as Date

For Time

Time(Datetime,'hh:mm:ss') as time

View solution in original post

8 Replies
er_mohit
Master II
Master II

date(Datetime,'DD-MM-YYYY') as Date

For Time

Time(Datetime,'hh:mm:ss') as time

Gysbert_Wassenaar

Use the floor function to cut of the time part: floor(MyTimestamp) as MyDate


talk is cheap, supply exceeds demand
Not applicable
Author

If you change the format of date field, then try this

date(datetime,'DD/MM/YYYY')

now if you want to change its name then,

datetime as Date

vivientexier
Partner - Creator II
Partner - Creator II

Hi,

Format or Value !

This 2 anwsers are corrects but the restult is different. You need to understand the difference.

Er.mohit give you a solution to change your field format. QlikView will present you a Date format but the value will still be a timestamp (date & time).

Gysbert Wassenaar change your field value from a timestamp to a date (no more time).

Anonymous
Not applicable
Author

Where do i add this?

date(Datetime,'DD-MM-YYYY) as Date

SQL

SELECT column_that_needs_changing(Datetime,'DD-MM-YYYY) as Date,

?

Thanks, nearly there

Not applicable
Author

in your script

where your clumn name present

example

load a,

b,

date(Datetime,'DD-MM-YYYY) as Date

from..

write this

Anonymous
Not applicable
Author

Thanks guys.

er_mohit
Master II
Master II

if your problem is resolved then you have to mark it either correct or helpful answer to closed this thread.so that it might be helpful for other developer.

Regards

Mohit