Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Time from Datetime

QV12 SR3

I have the following Datetime field

MyDatetimeDateTime
10/01/2011  12:02:0710/01/201112:02

I want to extract the Date and Time from it but i only want the hh:mm part of the time (like above)

I can get the date with this...

Date(Floor(MyDatetime))

i thought this might help me get the time portion i need but i'm missing something somewhere...

Time(Time#(Frac(MyDatetime),'hh:mm:ss'),'hh:mm')

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Specialist
Specialist

Re: Time from Datetime

use like this:

=Timestamp(MyDatetime,'hh:mm')

View solution in original post

7 Replies
Highlighted
Specialist
Specialist

Re: Time from Datetime

check with :

=Timestamp(MyDatetime)

Highlighted
Specialist
Specialist

Re: Time from Datetime

date(date#('10/01/2011 12:02:07','DD/MM/YYYY hh:mm:ss'),'DD-MM-YYYY') as Date,

Timestamp(date#('10/01/2011 12:02:07','DD/MM/YYYY hh:mm:ss'),'hh:mm')  as Time

Highlighted

Re: Time from Datetime

May be this:

Time(Round(Frac(MyDateTime), (1/24*60))) as Time

or

Time(Floor(Frac(MyDateTime), (1/24*60))) as Time

Highlighted
Specialist
Specialist

Re: Time from Datetime

use like this:

=Timestamp(MyDatetime,'hh:mm')

View solution in original post

Highlighted
Specialist
Specialist

Re: Time from Datetime

Only this much should work bcs your MyDatetimeis proper format I guess

Thanks

Highlighted
Creator III
Creator III

Re: Time from Datetime

Thanks all

Timestamp(MyDatetime,'hh:mm')   works nicely


the others didn't seem to quite work but interesting

Highlighted
Specialist
Specialist

Re: Time from Datetime

The simple wat to check wthr u can go ahead and use Date and time functions bfr jumping into string fns,any function on dates is to add the date column in to list box then check if the values r falling on right side of list box then Qlik has taken it as date,if values fall on left side of list box then Qlik didn't.

Plss check HIC docs on date.Thanks