November 9, 201114 yr I've created a birthdate, Now I need to extract into number form the Month, Day and Year. Certainly there is a simple solution to this... I;ve tried Brian Dunning's as follows with no success so far... Case ( Patient_DateofBirth = "January"; 1; Patient_DateofBirth = "February"; 2; Patient_DateofBirth = "March"; 3; Patient_DateofBirth = "April"; 4; Patient_DateofBirth = "May"; 5; Patient_DateofBirth = "June"; 6; Patient_DateofBirth = "July"; 7; Patient_DateofBirth = "August"; 8; Patient_DateofBirth = "September"; 9; Patient_DateofBirth = "October"; 10; Patient_DateofBirth = "Nov"; 11; Patient_DateofBirth = "November"; 11; Patient_DateofBirth = "december"; 12; // default 0 ) Much thanks all! Dr.L
November 9, 201114 yr Then how about = Month ( Patient_DateofBirth ) See also: http://www.filemaker.com/11help/html/func_ref1.31.12.html#1028277
November 9, 201114 yr Author Bingo! When now that was easy enough...swear I tried that first, must have missed something as it returned the name of the month. Must have only used it as a text rather than as a number in the calculation... This works also for day and year. THANK YOU! Dr.L
November 9, 201114 yr must have missed something as it returned the name of the month. That would have been = MonthName ( Patient_DateofBirth )
November 9, 201114 yr Author Understood...as usual it must have been user error. I believe I may have had it returned as a text rather than as a number...all is well now! Dr.L
November 9, 201114 yr I believe I may have had it returned as a text rather than as a number...all is well now! Just to clarify: the Month() function always returns a number; if you set the result to Text, it will be converted to digits of that number. For example: Month ( SomeDate ) // returns 4 (number) GetAsText ( Month ( SomeDate ) ) // returns "4" (text)
November 10, 201114 yr Author It seems as though I do have one more question about the date format...once I use: Year (date), how can I trim it to just show the last two digits for the year? Dr.L
Create an account or sign in to comment