Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Im currently loading a file from excel that has a colum of Date with this format 08.01.2014 21:13, and im not sure how to edit this on the script so i only have the Date without the hour. Or even maybe a field with Date and another with hour, or a field that i can use Week(Date) and even if it has the hour it'll work.
I've currently tryed to use Date(field,'DD/MM/YYYY') and it doesn't work.
Anyone can knows how to do this?
thanks,
I'm not sure if you can have a time stamp in the date#() function. You may need to use (and note that the floor will take the time stamp away):
date(floor(timestamp#(YourField, 'DD.MM.YYYY hh:mm')), 'DD/MM/YYYY')
Maybe try date(date#(field, 'DD.MM.YYYY hh:mm'), 'DD/MM/YYYY')
I'm not sure if you can have a time stamp in the date#() function. You may need to use (and note that the floor will take the time stamp away):
date(floor(timestamp#(YourField, 'DD.MM.YYYY hh:mm')), 'DD/MM/YYYY')
Date:
LOAD * INLINE
[
Date
08.01.2014 21:13
];
Final:
Load
date(date#(Date, 'DD.MM.YYYY hh:mm'), 'DD/MM/YYYY') as FinalDate
RESIDENT Date;
DROP TABLE Date;
This works so I believe date#() recognizes a time stamp.
I think this is not the most elegant solution but it works:
date(date#(left(TimestampField, 10), 'DD.MM.YYYY'), 'DD/MM/YYYY')