4 Replies Latest reply on Nov 9, 2009 9:36 AM by philmodjunk

    Automate a Date Find

    Pizon

      Title

      Automate a Date Find

      Post

      I have a DB of about 1500 records consisting of several fields (Names,Phones, and DOB).

       The important field is DOB (date of birth). My goal is to do a find for those DOBs that fall on today, CurrentDate.

       

      I need to match the Month and Day of DOB with the Month and Day of the  CurrentDate;

      the year isn't important.

      I would like to automate this "find" when I open this DB.

       

      Would you give me a little "push" in the right direction?

       

      Calculations fields employed thus far:

      MM                          Calculation          =Month(DOB)

      DD                                  "                   =Day(DOB)

      CurrMonth                     "                   =Month(Get(CurrentDate))

      CurrDay   "                        =Day(Get(CurrentDate))

       

      Thanks in advance for any help you might provide!! 

        • 1. Re: Automate a Date Find
          david_lalonde@d-cogit.ca
            

          Look up FileMaker Pro's help on finds in date field. There is some pertinent information on the use of wildcards which will solve your problem. There is actually no need for the calculation fields you mentioned.

           

          You can launch a script upon opening a file. Look at the "File Option" menu item.

           

          I hope this is just the right kind of "push" you were looking for. 

          • 2. Re: Automate a Date Find
            webflys1
              

            Pizon -

             

            1) Create a new DATE FIELD and format the date to your specs (xx/xx/xx) or xx/xx/xxxx or whatever...

             

            2) Depending on how you want to search, just grab the year from the date field like:

             

             

            Right ( DATEFIELD ; 2 )

             

            3) Create a new field CALCULATION and combine the month & day & year

             

            =MM&DD&YY

             

            4) Now you can create a script to find all records that match that date for today (perform find script):

             

            yourtable::yournewfield //

             

             

            5) Set the new script to run when you open the program and you should be all set.

             

            You COULD save a step from above but the logic is a bit long.

             

            • 3. Re: Automate a Date Find
              webflys1
                 SORRY - if your date is already ONE field then you only need to write the PERFORM FIND script for todays date "//" and run at launch.
              • 4. Re: Automate a Date Find
                philmodjunk
                  

                Another approach for dates:

                 

                Define a cBirthday calculation field as: Date ( Month ( BirthDateField) ; Day ( BirthDateField ) ; Year(GetCurrentDate)) // Make this an unstored calculation.

                 

                Now you can simply compare this field to today's date (Get (CurrentDate) ) to identify birthdays falling on today's date.