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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Retrieve Hour value from Date Field

I have a field that contains a date in the following format: 24/12/2002 12:31:00 AM

I need to be able to determine the hour that this occurred in.

Thanks in advance.

Labels (1)
2 Replies
Anonymous
Not applicable
Author

Here's a solution that takes into consideration a value like 5pm and returns 17 instead of 5, which would easily be mixed up with 5am:

=interval(frac(timestamp(timestamp#('24/12/2002 5:31:00 PM', 'DD/MM/YYYY hh:mm:ss TT'),'DD/MM/YYYY hh:mm:ss')), 'hh')

Not applicable
Author

Thanks works a treat.