Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Date Format

Hi,

I have a date field named ReportDate that is in format DD/MM/YYYY hh:mm:ss.

How can I format this to DD/MM/YYYY on my load statement?

Thanks

Daniel

1 Solution

Accepted Solutions
sunny_talwar

Another thing I would suggest is to use a Floor function to truncate the time portion of the date

Date(Floor(DateField)) as Date

View solution in original post

5 Replies
Chanty4u
MVP
MVP

try

loiad *,

Date(Date#(Datefield,,'DD/MM/YYYY hh:mm:ss'),'DD/MM/YYYY')   as newdate

resident table;

Chanty4u
MVP
MVP

check sample:

a:

LOAD * Inline [

date

11/02/1991 01:12:55

];

Result:

load *,

Date(Date#(date,'DD/MM/YYYY hh:mm:ss'),'DD/MM/YYYY')   as newdate

Resident a;

new.PNG

sunny_talwar

Good links to look at for issues related to dates:

Why don’t my dates work?

Get the Dates Right

sunny_talwar

Another thing I would suggest is to use a Floor function to truncate the time portion of the date

Date(Floor(DateField)) as Date

marcus_sommer

To get a real date from a timestamp you need to cut the time-part, maybe in this way:

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

and if ReportDate isn't regocnized as timestamp you need to convert it per timestamp#() like:

date(floor(timestamp#(ReportDate, 'DD/MM/YYYY hh:mm:ss')), 'DD/MM/YYYY')

- Marcus