See this knowledgeBase article: http://help.filemaker.com/app/answers/detail/a_id/3926/kw/weekend
There are other, more sophisticated approaches where you set up and maintain a "calendar" of the days you are open for business and then you can count the number of "open" days between two dates via this calendar. That approach can make it easier to allow for week days where you were closed due to a holiday or unforseen event.
No this solution won't work because it is when you want to calculate a finish date. I actually want to calculate how long the project took, excluding weekends
Do you also need to exclude other days when you were closed in addition to week ends?
Yes I do
Then you will need a table that records each additional day that you are closed so that they can be deducted from the calculation's total days.
Use this relationship:
YourTable::Date1 < DaysClosed::Date AND
YourTable::Date2 > DaysClosed::Date
For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained
To Compute Elapsed Days
Let ( [ D1 = Date1 + ( DayOfWeek ( Date1 ) = 7 ) ;
D2 = Date2 - ( DayOfWeek ( Date2 ) = 7 )
D2 - D1 - Div ( D2 - D1 ; 7 ) * 2 - Count ( DaysClosed::Date )
I tested this in the DataViewer by trying out a number of different dates and it appears to return the correct results.