Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Expression

Hi how do I format a date and time into a date only expression

YYYY/MM/DD 12:00:00 AM to YYYY/MM/DD

6 Replies
sunny_talwar

May be this:

Date(Floor(DateandTimeField), 'YYYY/MM/DD') as Date

or if it isn't read as timestamp, then this:

Date(Floor(TimeStamp#(DateandTimeField, 'YYYY/MM/DD h:mm:ss TT')), 'YYYY/MM/DD') as Date

Check here for more understanding about date in QlikView

QlikView Date fields

Why don’t my dates work?

Get the Dates Right

Anonymous
Not applicable
Author

date(floor(yourdatefield),'YYYY/MM/DD')

floor could be optional

vishsaggi
Champion III
Champion III

Try this may be?

Replace the date with your DateField without Quotes.

= Date(Date#('2017/02/08 12:00:00 AM', 'YYYY/MM/DD hh:mm:ss tt'), 'YYYY/MM/DD')

sunny_talwar

I would use Floor() function or DayName to get rid of time component here...

vishsaggi
Champion III
Champion III

Got it. Yes, it is better to use the Floor() to convert easily.

Anonymous
Not applicable
Author

Try;

=Date(MakeDate(Subfield(DateTime,'/',1),Subfield(DateTime,'/',2),Subfield(Subfield(DateTime,'/',3),' ',1)),'YYYY/MM/DD')