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

Convert Date Time to Date

Hi Guys,

I need to convert my date, (a number like 45302.8333) to date data type, but without the hour.

I using the following. Is there any better way to do it?

Thanks,

Aldo.

Date( num#(PaymentDate) - Frac(PaymentDate), 'DD/MM/YYYY')



Labels (1)
1 Solution

Accepted Solutions
hector
Specialist
Specialist

Hi, you can use dayname(field), and this will return only the date part


dayname(45302.8333) = 11-01-2024
timestamp(dayname(45302.8333)) = 11-01-2024 0:00:00


So you can see, the decimal part is removed this is something like date(floor(field))

Rgds

View solution in original post

3 Replies
tresB
Champion III
Champion III

Hi,

If your PaymentDate itself has the numeric values, why can't you simply use: Date(PaymentDate,'DD/MM/YYYY')? fraction would not bother you.

hector
Specialist
Specialist

Hi, you can use dayname(field), and this will return only the date part


dayname(45302.8333) = 11-01-2024
timestamp(dayname(45302.8333)) = 11-01-2024 0:00:00


So you can see, the decimal part is removed this is something like date(floor(field))

Rgds

Not applicable
Author

Thanks