Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
In my data table I have following field
Month_Year
JAN_2014
FEB_2014
.......
In my load load script I want to load two separate fields Month and Year
Pls help me to write script
year(date#(Month_Year,'MMM_YYYY')) as Year
month(date#(Month_Year,'MMM_YYYY')) as Month
-Rob
Thanks it is working. I forgot to tell you I want extract month number like 1,2,3
Month returns a dual, which is both a number and a string. The string will be used for display and the number used automatically for sorting and arithmetic.
you can explicitly extract the number of the month by adding a num() function.
num(month(date#(Month_Year,'MMM_YYYY'))) as Month
-Rob