Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
if have a inline data , i have taken timestamp as a string now i want to read it so i can convert it into number form or do some calculations on it. code is given below n this is what i am trying to do to make it work.
T1:
load *,
Timestamp(Timestamp#(Date,'DD-MM-YYYY hh:mm:ss TT'),'MM/DD/YYYY hh:mm:ss ') as newDate
;
LOAD * INLINE [Date
"01-02-2015 3:29 PM"
"01-03-2015 11:43 PM"
"01-02-2015 3:29 PM"
];
load *,
Timestamp(Timestamp#(Datetime,'DD-MM-YYYY hh:mm TT'),'MM/DD/YYYY hh:mm:ss') as newDate
;
LOAD * INLINE [
Datetime
"01-02-2015 3:29 PM"
"01-03-2015 11:43 PM"
"01-02-2015 3:29 PM"
];
hh means that the hours are zero padded. This should work:
Timestamp(Timestamp#(Date,'DD-MM-YYYY h:mm:ss TT'),'MM/DD/YYYY hh:mm:ss ')
If not, then use the Alt() approach:
Timestamp(
Alt(Timestamp#(Date,'DD-MM-YYYY hh:mm:ss TT'),
Timestamp#(Date,'DD-MM-YYYY h:mm:ss TT')
)
,'MM/DD/YYYY hh:mm:ss ')
load *,
Timestamp(Timestamp#(Datetime,'DD-MM-YYYY hh:mm TT'),'MM/DD/YYYY hh:mm:ss') as newDate
;
LOAD * INLINE [
Datetime
"01-02-2015 3:29 PM"
"01-03-2015 11:43 PM"
"01-02-2015 3:29 PM"
];
hi, its not working but thanx for help