Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
=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')))
Date(Floor(Date_field)) as Date,
Time(Floor(Date_Field)) as Time,
Year(Floor(Date_field)) as Year
You could also use the DayName() function.
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
one example:
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
Try, left(FieldName,'MM/DD/YYYY'),10).
Thanks,
It's works,
Thank you!