Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get date from date and time format timestamp

Good Day

I'm having difficulty in extracting data

how can I get the date only from a date-time format

example:

12/27/2014  2:25:07 PM

--> I want to get only 12/27/2014

when I use Date(Func_End, 'MM/DD/YYYY'), all the dates becomes 12/01/2014

Please help me

Thank you

7 Replies
MK_QSL
MVP
MVP

=Date(Floor(Timestamp#('12/27/2014  2:25:07 PM','MM/DD/YYYY  h:mm:ss TT')))

or

=Date(Floor(Timestamp#(YourTimeStampFieldName,'MM/DD/YYYY  h:mm:ss TT')))

for time

=Time(Frac(Timestamp#(YourTimeStampFieldName,'MM/DD/YYYY  h:mm:ss TT')))

vardhancse
Specialist III
Specialist III

Date(Floor(Date_field)) as Date,

Time(Floor(Date_Field)) as Time,

Year(Floor(Date_field)) as Year

MarcoWedel

You could also use the DayName() function.

buzzy996
Master II
Master II

try tis way,

date#(A,'YYYY.MM.DD') where A=1997.08.06 returns

or

date#(A,'YYYY/MM/DD') where A=1997/08/06 returns

MarcoWedel

one example:

QlikCommunity_Thread_169545_Pic1.JPG

tabDateTimes:

LOAD *,

    DayName(YourTimestamp) as YourDate,

    Time(Frac(YourTimestamp)) as YourTime;

LOAD Timestamp#(Func_End,'MM/DD/YYYY  hh:mm:ss TT') as YourTimestamp

Inline [

Func_End

12/27/2014  2:25:07 PM

12/28/2014  3:26:08 PM

12/29/2014  4:27:09 PM

12/30/2014  5:28:10 PM

12/31/2014  6:29:11 PM

01/01/2015  7:30:12 PM

];

hope this helps

regards

Marco

Not applicable
Author

Try, left(FieldName,'MM/DD/YYYY'),10).

Thanks,

enriquem
Creator
Creator

It's works,

Thank you!

Kind Regards,
Enrique Mora.