Thursday, November 6, 2014

OBTENER EL NUMERO DEL MES FILEMAKER

Les muestro un script para determinar el número de mes

/*MonthNameToMonth custom function
Author: Daniele Raybaudi
Format: MonthNameToMonth ( the MonthName ; start )
Parameters: theMonthName - textstart - number (must be set to 1)
Returns the month number of the given monthName
*/
Let([date = Date ( start ; 1 ; 1 );
month = Month ( date )];
Case(start > 12 or IsEmpty ( theMonthName ) ;
"?" ;
MonthName ( date ) = theMonthName ;
month ;MonthNameToMonth ( theMonthName ; start + 1 )))

Entrada: MonthNameToMonth ( "february" ; 1 )
Salida: 2

No comments:

Post a Comment