Dr.L Posted November 9, 2011 Posted November 9, 2011 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
comment Posted November 9, 2011 Posted November 9, 2011 Then how about = Month ( Patient_DateofBirth ) See also: http://www.filemaker.com/11help/html/func_ref1.31.12.html#1028277
Dr.L Posted November 9, 2011 Author Posted November 9, 2011 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
comment Posted November 9, 2011 Posted November 9, 2011 must have missed something as it returned the name of the month. That would have been = MonthName ( Patient_DateofBirth )
Vaughan Posted November 9, 2011 Posted November 9, 2011 The MonthName() function returns the name of the month.
Dr.L Posted November 9, 2011 Author Posted November 9, 2011 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
comment Posted November 9, 2011 Posted November 9, 2011 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)
Dr.L Posted November 10, 2011 Author Posted November 10, 2011 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
Dr.L Posted November 10, 2011 Author Posted November 10, 2011 Just figured that out...I was trying to trim first...THANKS! Dr.L
Recommended Posts
This topic is 4796 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now