4 Replies Latest reply on Dec 26, 2009 4:07 PM by MJWebster

    Creating a Year of Birth

    MJWebster

      Title

      Creating a Year of Birth

      Post

      Hello, 

       

      Just wondering if the following is possible?

       

      I have a field in my database for the age of someone (AGE). I also have a field for Date of Enrolment (DATE ENROLLED). 

       

      The idea here is to enter the age of someone ie 40, and then enter the date enrolled, 22 May 1902, what I wanted then was a field called Approx Year of Birth, in this field it would take 40 from 1902 = 1862... however how can I do this when the field (Date Enrolled) has the format that I set up as Day, Month and Year?

       

      Hope this makes some sense...

       

      Running Filemaker 10 on Apple Mac (Snow)

       

      Thanks for any help..

       

      Regards, Malcolm  

        • 1. Re: Creating a Year of Birth
          comment_1
            

          MJWebster wrote:

          the field (Date Enrolled) has the format that I set up as Day, Month and Year?


          What is the field's type? Is it a Date field formatted to display as d/mmm/yyyy - or is a Text field containing a string like "2 May 1902"?


          • 2. Re: Creating a Year of Birth
            MJWebster
              

            Hello, 

             

            Thanks for your reply.. I set up the Date Enrolled field as a Date field..

             

            Don't worry if it can't be done, but I thought that it would be helpful if I could calculate a number field (AGE) with a Date field (Date Enrolled)..

             

            Regards, Malcolm 

            • 3. Re: Creating a Year of Birth
              comment_1
                

              MJWebster wrote:
              Don't worry if it can't be done, but I thought that it would be helpful if I could calculate a number field (AGE) with a Date field (Date Enrolled)..

              Of course it can be done - in fact, it's very easy to do: make YearOfBirth a calculation field (result is Number) =

               

              Year ( DATE ENROLLED ) - AGE

               

              This assumes you have valid dates in the  DATE ENROLLED field. If by chance you have imported text data into a date field, then you'll need to take care of that first.

               

               

              BTW, you could reduce the average error by making the calculation =

               

              Year ( DATE ENROLLED ) - AGE - ( Month ( DATE ENROLLED ) < 7 )

              • 4. Re: Creating a Year of Birth
                MJWebster
                  

                Hello, 

                 

                Many thanks indeed for your help with this..

                 

                I have much to learn..

                 

                Regards, Malcolm