Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get a date without the time of the day

I have something like this in my script:

date(date#(RetireDate,'DD/MM/YYYY'),'DD/MM/YYYY') as RetireDateDate,

But when I show this on a report table it shows 20/03/2009 12:00

How to get rid of the 12:00?

1 Solution

Accepted Solutions
Not applicable
Author

date(date#(RetireDate,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY') as RetireDateDate,


since my source includes hours and minutes.


floor only resets the hour to 00:00, but every date has an hour and minute.

View solution in original post

11 Replies
marcus_sommer

Try this:

date(floor(date#(RetireDate,'DD/MM/YYYY')),'DD/MM/YYYY') as RetireDateDate

- Marcus

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Try this:

date(Floor(date#(RetireDate,'DD/MM/YYYY')),'DD/MM/YYYY') as RetireDateDate,


Hope this helps,


Jason

pennetzdorfer
Creator III
Creator III

Please try

date(floor(date#(RetireDate,'DD/MM/YYYY')),'DD/MM/YYYY') as RetireDateDate


Do you really need the date#()? I guess it should also work like:

date(floor(RetireDate),'DD/MM/YYYY') as RetireDateDate


Regards,

Florian

Not applicable
Author

date(date#(RetireDate,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY') as RetireDateDate,


since my source includes hours and minutes.


floor only resets the hour to 00:00, but every date has an hour and minute.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

But you said you wanted to get rid of the hours and minutes...?

How to get rid of the 12:00?
Not applicable
Author

Yes and I got rid of it with my solution

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Your solution doesn't remove it - it merely hides it.  If you were to put RetireDateDate into a list box you would get what looks like loads of duplicates. This is because the underlying number (remember dates are numbers just formatted in a particular way) still retains the decimal portion which is the time.

Not applicable
Author

<quote>floor only resets the hour to 00:00, but every date has an hour and minute.</quote>

Yes the Date is a number and always have the hours and minutes and even milliseconds.

That was what I was trying to say.

Any way I tested adding this field to a listbox and it hides the hours and minutes.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

But you get what look like duplicates in the list box do you not?  How is that useful?