3 Replies Latest reply on Feb 5, 2014 1:36 PM by erolst

# Starter Solution: Projects - Days Elapsed

Hello,

I'm just beginning with scripts and calculations, just purchased FMP Advanced, and had a script question and a referral question, please.

Question 1: I'm using the 'Projects' Starter Solution, and noticed that the 'Days Elapsed' uses the GetWorkDays function, where I'd like the elapsed days to include weekends. How could this be rewritten to include weekends? (this is the existing calculation from the Starter Solution)

Let (
[
today = Get ( CurrentDate ) ;

yet = Start Date ≤ today
and
Due Date ≥ today ;

future = Start Date ≥ today
and
Due Date ≥ today ;

active days = GetWorkDays ( Start Date ; today ) ;
completed days = GetWorkDays ( Start Date ; Due Date )
] ;

Case (
yet ; active days ;
future ; 0 ;
completed days
)
)

Question 2: What, in your opinion, is the BEST reference material (book, video, manual, etc.) for learning calculations, scripts, and how to use functions, for a beginner? Would appreciate your expert opinions, to focus on the best material.

Thank you, very much!

Tim

• ###### 1. Re: Starter Solution: Projects - Days Elapsed

timsea wrote:

How could this be rewritten to include weekends?

Replace

GetWorkDays ( Start Date ; today ) with today - Start Date

and

GetWorkDays ( Start Date ; Due Date ) with Due Date - Start Date

To find the number of (all) days between two dates, you don't need a CF; as you can see, in FM the method is as simple as laterDate - earlierDate.

As to reference material, I can recommend books from QUE, but I don't know if they have (yet) published a book on FM13.

• ###### 2. Re: Starter Solution: Projects - Days Elapsed

Thank you, very much, erolst!   That works perfectly!

Also, I appreciate your recommendation on the books from QUE.  I'll take a look at those for FMP 12, as a start.   If any specific titles stand out over the others, would enjoy hearing which ones.

Thanks again,

Tim

• ###### 3. Re: Starter Solution: Projects - Days Elapsed

timsea wrote:

I'll take a look at those for FMP 12, as a start.   If any specific titles stand out over the others, would enjoy hearing which ones.

From QUE, there is “only” Jesse Feiler's book on FM12, but it is excellent (and the latest, updated edition of a “very” comprehensive book on FileMaker 7 from 2004). But be aware that FM13 brought many new features you'd want to see covered in a reference manual.

To my knowledge, there were no “bad” books on FM12, but I couldn't recommend one over the other (except for the above).

Ray Cologon's FileMaker 10 Bible is terrific, but … well, the name says it all, and there is no newer edition.

Then there is of course the official FileMaker Traing Series, which has just been updated to 13 (and which is, IIRC, included in the paid variant of the Technet membership). Personally, I find it a bit dry, but YMMV …

You may also want to consider studying some general books on programming (languages); FM is quite peculiar in certain respects, but it doesn't exist in a vacuum, and the usual best practices and approaches apply here, too.

In case you're interested in a more individual approach, drop me a PM.