Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In the source data is a date stamp given like: 3/8/2016 8:00:00 AM
This has to be transform to only the date 08-03-2016 so I can use it in a chart.
Caution by a date 3/16/2016 is an extra character.
The transformation has to be done in the script.
Can you help me with the script?
Thanks in advance.
Ralph
I don't know what the difference is between the dates, they all look the same. See the attached
Script:
Data:
LOAD [Technical Designation],
[User Designation],
[System Description],
Parameter,
Value,
Unit,
Status,
[Value Timestamp],
Date(Floor(TimeStamp#([Value Timestamp], 'M/D/YYYY h:mm TT')), 'DD-MM-YYYY') as [Value Date]
FROM
Database*.xls
(biff, embedded labels, header is 19 lines, table is [Installatie Status PX Tapwater$]);
May be this:
Date(Floor(TimeStamp#(DateField, 'M/D/YYYY h:mm:ss TT')), 'DD-MM-YYYY') as DateField
load
datefield,
Date(Floor(Date#(datefield, 'M/D/YYYY h:mm:ss tt')), 'MM-DD-YYYY') as datefieldnew
inline [
datefield
3/8/2016 8:00:00 AM
];
Hello Sunny T,
Thank you for you're reaction.
Sorry but it doesn't work.
Seems to be working here:
Script:
Table:
LOAD *,
Date(Floor(TimeStamp#(DateField, 'M/D/YYYY h:mm:ss TT')), 'DD-MM-YYYY') as NewDateField;
LOAD * Inline [
DateField
3/8/2016 8:00:00 AM
];
Can you have more than one space between the date and time? You will have to adjust the highlighted part of the expression to match your current timestamp format
Hello maxgro,
Thanks, but it won't work. Can you help me further, below the script.
Value Timestamp is the date i.e. [3/25/2016 8:10:25 AM ]
Data:
LOAD [Technical Designation],
[User Designation],
[System Description],
Parameter,
Value,
Unit,
Status,
[Value Timestamp]
FROM
[Data\Legionella\Installatie Status PX *.xls]
(biff, embedded labels, header is 19 lines, table is [Installatie Status PX Tapwater$]);
load
[Value Timestamp],
Date(Floor(Date#([Value Timestamp], 'M/D/YYYY hh:mm:ss tt')), 'MM-DD-YYYY') as Date2
inline [Value Timestamp];
Try it like this:
Data:
LOAD *,
Date(Floor(TimeStamp#([Value Timestamp], 'M/D/YYYY h:mm:ss TT')), 'DD-MM-YYYY') as [Value Date];
LOAD [Technical Designation],
[User Designation],
[System Description],
Parameter,
Value,
Unit,
Status,
[Value Timestamp]
FROM
[Data\Legionella\Installatie Status PX *.xls]
(biff, embedded labels, header is 19 lines, table is [Installatie Status PX Tapwater$]);
=Date(Floor(TimeStamp#('3/8/2016 8:00:00 AM', 'M/D/YYYY h:mm:ss TT')), 'DD-MM-YYYY')
You're attachment works also by me but in the file it doesn't.
I will attach the qwv file and database
Your timestamp did not have seconds:
LOAD *,
Date(Floor(TimeStamp#([Value Timestamp], 'M/D/YYYY h:mm TT')), 'DD-MM-YYYY') as [Value Date];
LOAD [Technical Designation],
[User Designation],
[System Description],
Parameter,
Value,
Unit,
Status,
[Value Timestamp]
FROM
Database.xlsx
(ooxml, embedded labels, header is 19 lines, table is [Installatie Status PX Tapwater]);