I've gotten you a little closer, I think - save the attached file locally, right click, select Design and then you can preview, etc. The main diff I saw between your form and the sample you linked is that your form is a SharePoint list form, so you don't have plain date datatypes - even if the list is set to only display dates, it will store date/times. So I had to modify any reference to the firstday and lastday fields to use substring-before(field, "T") to return the just date part. However, I was still occasionally seeing the calc error - I just don't have time today to see if I can discern a pattern. Maybe you can try some different date combos and see if you can see when it fails? :-)
Hilary Stoupa
