Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i have a filed name xxxdate, and cuid, in this wanna get month and year and date in diffrent field
In the xxxdate field my date format is like this 1/1/2014 12:02:15 AM
Please let me know the answer
thanks
If xxxdate contains string values use the timestamp# function to create timestamps from the strings. If your xxxdate field already contains numeric timestamps then you can use the year, month and other functions directly on the xxxdate field.
LOAD
xxxdate,
year(xxxdate) as Year,
month(xxxdate) as Month,
day(xxxdate) as Day,
date(floor(xxxdate)) as Date,
time(frac(xxxdate)) as Time;
LOAD
timestamp#(xxxdate,'D/M/YYYY hh:mm:ss TT') as xxxdate
FROM ...somewhere...;
If xxxdate contains string values use the timestamp# function to create timestamps from the strings. If your xxxdate field already contains numeric timestamps then you can use the year, month and other functions directly on the xxxdate field.
LOAD
xxxdate,
year(xxxdate) as Year,
month(xxxdate) as Month,
day(xxxdate) as Day,
date(floor(xxxdate)) as Date,
time(frac(xxxdate)) as Time;
LOAD
timestamp#(xxxdate,'D/M/YYYY hh:mm:ss TT') as xxxdate
FROM ...somewhere...;
Hi ,
thanks for ur reply but prob is that .... date foramt is like this
8/1/2014 12:12:23 AM
int his How to do ?
Hi,
Ckeck this
Load
Date(Date#(Date,'M/D/YYYY HH:MM:SS TT')) as PostingDate,
Year(Date#(Date,'M/D/YYYY HH:MM:SS TT')) as Year,
Month(Date#(Date,'M/D/YYYY HH:MM:SS TT')) as Month;
load * Inline
[
Date
1/1/2014 12:02:15 AM
];
Regards
ASHFAQ
Let's try that again:
If xxxdate contains string values use the timestamp# function to create timestamps from the strings.
LOAD
xxxdate,
year(xxxdate) as Year,
month(xxxdate) as Month,
day(xxxdate) as Day,
date(floor(xxxdate)) as Date,
time(frac(xxxdate)) as Time;
LOAD
timestamp#(xxxdate,'D/M/YYYY hh:mm:ss TT') as xxxdate
FROM ...somewhere...;
If your xxxdate field already contains numeric timestamps then you can use the year, month and other functions directly on the xxxdate field.
LOAD
xxxdate,
year(xxxdate) as Year,
month(xxxdate) as Month,
day(xxxdate) as Day,
date(floor(xxxdate)) as Date,
time(frac(xxxdate)) as Time
FROM ...somewhere...;