Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have a period Name field that has values as Mar-14 where 14 stands for the the year.
If I want to derive the year from this field using the year function something like YearName([Period Name]=2014
What is the best way to achieve it?
Try
=YEAR(Date#('Mar-14 ','MMM-YY'))
or in script
=YEAR(Date#(Name,'MMM-YY')) as Year
If the period is a string you can do:
num(subfield(Period, '-', 2)) as Year
If the period was loaded as a Date, you can do:
Year(Period) as Year
-Rob
Hi,
You can try this.
In Script.
Date(Date#(Year_Field_Name,'MMM-YY'),'YYYY') as Extract_Year,