Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey Guys,
I'm trying to pull a list of MonthYear and convert it to a number of the monthstart.
subfield(GetFieldSelections(MonthYear, ';'), ';',1)
Once I get it to this point it brings in the first MonthYear selected it is then converted to text. For example, (Jan-2010) but I need it as 40209 (1-31-2010).
I have tried wrapping date and num around it but then I get null.
I thought about doing a left 3 to grab the month and then a right 4 to grab the year. Then using makedate, but the month isn't a number.
Your only problem might be that you need to wrap date#() instead of date():
num(date#(subfield(GetFieldSelections(MonthYear, ';'), ';',1),'MMM-YYYY'))
I think this would give the same result more efficiently, assuming MonthYear is sorted ascending (otherwise use max):
if(getselectedcount(MonthYear),num(min(MonthYear)))
Or if you don't mind taking the min of all possible values when nothing is selected:
num(min(MonthYear))
Your only problem might be that you need to wrap date#() instead of date():
num(date#(subfield(GetFieldSelections(MonthYear, ';'), ';',1),'MMM-YYYY'))
I think this would give the same result more efficiently, assuming MonthYear is sorted ascending (otherwise use max):
if(getselectedcount(MonthYear),num(min(MonthYear)))
Or if you don't mind taking the min of all possible values when nothing is selected:
num(min(MonthYear))
Thanks John! date# worked!