Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i am having data like this
Year
03/2016
03/2015
01/2016
12/2015
01/2015
05/2015
06/2015
02/2016
11/2015
08/2015
10/2015
04/2016
05/2016
09/2015
07/2015
04/2015
02/2015
];
i did the following
LOAD*,
month(SubField(Year,'/','1')) as newmonth,
Year(SubField(Year,'/','1')) as newyear;
but not getting the result
any idea?
Month(Date#(Year, 'MM/YYYY')) as Month
Year(Date#(Year, 'MM/YYYY')) as Year
Try.
LOAD*,
Month(Date#(SubField(Year,'/','1'),'MM')) as newmonth,
SubField(Year,'/','2')) as newyear;
Left(Year,2) will give month and
Right(Year,4) will give year
HI,
I would say it because you are just present the number and asking from the month or Year.
Normally you would use them to strip out a month or year from a date. so maybe try
Month(DATE(Year,MM/YYYY)) AS Newmonth,
Taking out the Month() and Year() functions should work to.
Also
Left(Year,2) as Newmonth,
Right(Year,4) as Newyear
Mark
month is fine
year i am having 2015,2016
but result is
2001 to 2012
why?
PFA
Vikas
Month(Date#(Year, 'MM/YYYY')) as Month
Year(Date#(Year, 'MM/YYYY')) as Year
I have changed it.
SubField(Year,'/','2')) as newyear;
i will try and get back
thanks
Data:
Load
MonthYearField,
Month(Date#(MonthYearField,'MM/YYYY')) as Month,
Year(Date#(MonthYearField,'MM/YYYY')) as Year
From YourTableName;