5 Replies Latest reply on Aug 21, 2009 1:42 AM by comment_1

    Simple date calculation



      Simple date calculation




      I haven't used Filemaker for about 8 years. So I am very rusty. 


      I have a date field that will be entered at the creation of the record and I need the next field to be a date automatically set to 5 years on. I then need to have an email sent to a manager on that fifth anniversary date. 


      Ultimately I want a database that can pick up and read CSV text from an email then import it as a record. (This can be done manually but it would be nice.) 


      Is this possible in Filemaker Pro 10.



        • 1. Re: Simple date calculation

          You can use an auto-enter on a date field of: Date ( Month ( zCreationDate ); Day ( zCreationDate ); Year ( zCreationDate ) + 5 ), where zCreationDateis your creation date field.



          You can either use a On install timer script step or as part of your opening script check to see if any emails need to be sent by doing a find in that future date field, for the current date.


          • 2. Re: Simple date calculation

            Thanks for that. The date field works well.


            I have started an open script where i have it as


            Perform Find/Replace   database1::NextReviewDate; Find Next   (in specify calculation i have)   databaseInfo1.cvs Converted 2::Next ReviewDate

            Send Mail Send via E-mail Client; To: "Bla Bla"


            In the first line what would I put to set the current date ( the day that the script is run)?



            • 3. Re: Simple date calculation

              No the opening script should be doing a find.


              Enter Find  Mode []

              Set Field [ ReminderDate; Get (CurrentDate )]

              Perform Find[]



              As for your import from a email, you will have to somehow first get the email into filemaker ( using a plugin like 360 works email that does Pop3 and IMAP ) then grab the attachment and imports it into a FileMaker file. Not really a beginner's task but can be done.

              • 4. Re: Simple date calculation

                Thanks again, The email entry can be done manually.





                • 5. Re: Simple date calculation

                  1. You don't really need another field for this - you can find records that have been created 5 years ago, searching the creation date directly.


                  2. You should be looking for records that are 5 years old or older and haven't been processed yet - otherwise you can miss records whose 5 year anniversary falls on a non-work day, for example.