Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This is the format I have. Now I want to split into Year, Month Year, Date, Week, Month and Time.
Can anyone help me out please.
If you have perfect timestamp filed then use
Date(DateField) as NewDateColumn,
Year(DateField) as Year,
Month(DateField) as Month,
MonthName(DateField) as MonthYear,
Week(DateField) as Week,
Time(DateField) as Time
For
Year use
Year(Fieldname)
MonthYear
monthName
Date use
date or date# or timestamp or timestamp#
Week use
Week(fieldname)
month and time
Use
Month (Field) &' '& Time(Field)
Try
Year(field),Month(field),Date(),Week(),Time() correspondingly
Try with the scripts
LOAD
DateColumn,
Date(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT'),'MM-DD-YY') as NewDateColumn,
Year(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as Year,
Month(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as Month,
MonthName(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as MonthYear,
Week(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT')) as Week,
Time(Mid(Timestamp#(DateColumn,'MM-DD-YY hh:mm TT'),10,5),'hh:mm') as Time;
LOAD * Inline
[
DateColumn
10-24-13 12:00 AM
10-25-13 12:00 AM
10-26-13 12:00 AM
10-27-13 12:00 AM
10-28-13 12:00 AM
10-29-13 12:00 AM
10-30-13 12:00 AM
];
If you have perfect timestamp filed then use
Date(DateField) as NewDateColumn,
Year(DateField) as Year,
Month(DateField) as Month,
MonthName(DateField) as MonthYear,
Week(DateField) as Week,
Time(DateField) as Time
floor(field) to get the date
frac(field) to get the time