3 Replies Latest reply on Mar 20, 2017 2:34 AM by mikerevans

    GetWorkDays Function

    NewUser318

      Title

      GetWorkDays Function

      Post

           I am currently trying to replicate the "Tasks' starter solution in my company's Filemaker Pro 12 database. When re-writing some of the calculations, I noticed that my database doesn't offer the GetWorkDays Function. If I try to use the terminology in my script, then the program gives an error message saying it doesn't recognize the function. However, the "Tasks" starter solution uses this in one of the calculations for the "Days Til Due' Field. Is there a way I can get my database to recognize the "GetWorkDays" function? Or is there a substitution I can use?

            

            

      Screen_shot_2012-11-06_at_4.42.09_PM.png

        • 1. Re: GetWorkDays Function
          philmodjunk

               This is a custom function. If you have FileMaker Adavnced, you can import this custom function from the starter solution into your file.

               If it is not, you can adapt the calculation used in the custom function to get the same result:

               Int     ( ( DueDate - StartDate ) / 7 ) * 5

               +

               Case     (
                       DayOfWeek ( DueDate ) < DayOfWeek ( StartDate ) ;
                       Min ( 5 ; DayOfWeek ( DueDate ) - 1 ) + Max ( 0 ; 6 - DayOfWeek ( StartDate ) ) ;

                       DayOfWeek ( StartDate ) < 7 ;
                       Min ( 6 ; DayOfWeek ( DueDate ) ) - DayOfWeek ( StartDate ) ;

                       0
                       )

          • 2. Re: GetWorkDays Function
            mikerevans

            Hi Phil,

             

            Apologies again for being inexperienced, daysdue.JPG

             

            As you can see above is the calculation I'm trying to replicate. I do not have Filemaker advanced, so is it a case of replacing the word "GetWorkDays" with your text above?

             

            Thanks,

            Mike

            • 3. Re: GetWorkDays Function
              mikerevans

              I replaced it all with your formula.

               

              Thanks,

              Mike