Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a column with dates in the format 'DD-MM-YY'.
How can I get the value of the month, in a loading script?
I need to create a separate column in which I have to assign every date a month name.
Long story short, assuming I got a table column with the date in the mentioned format, how can I get the output below?
Date | Month |
---|---|
10-01-17 | January |
20-02-17 | February |
15-03-17 | March |
11-04-17 | April |
14-05-17 | May |
20-06-17 | June |
19-07-17 | July |
18-08-17 | August |
28-09-17 | September |
28-10-17 | October |
26-11-17 | November |
23-12-17 | December |
Set DateFormat ='DD-MM-YY';
LOAD Date,
Month(Date) as ShortMonth,
Text(Date(Date, 'MMMM')) as LongMonth
FROM ...;
edit:
or
...
Dual(Date(Date, 'MMMM'),Month(Date) ) as LongMonth
to keep the numerical month number in long format, too
Set DateFormat ='DD-MM-YY';
LOAD Date,
Month(Date) as ShortMonth,
Text(Date(Date, 'MMMM')) as LongMonth
FROM ...;
edit:
or
...
Dual(Date(Date, 'MMMM'),Month(Date) ) as LongMonth
to keep the numerical month number in long format, too
try this
Test:
LOAD * , date(Date#(Date,'DD-MM-YYYY'),'MMMM') as Rebate_New;
LOAD * Inline [
Date
10-01-17
];
Thanks! That's it
great:) please close the thread by making correct and helpful answer:)