Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Auto-calculating number of weeks from X

Featured Replies

  • Newbies

Good morning.

First off I would like to tell everyone how much I appreciate this forum, this is my first post although I have been reading almost everything I could for a good while.

I just started using Filemaker about 3 months ago or so, basically trying to satisfy the boss.

I work for a construction company, trying to keep track of our projects in-house.

I was wondering how I could make a field auto calculate the number of weeks from the project start date, we bill weekly.

For example, if we start the project on this Thursday, 1/19...any work we do from now until next Wed, 1/25, to put an automatic "1". Any work from 1/26 to 2/1, put an automatic "2" and so forth.

Any help would be appreciated, thank you.

Carmelo

If you have a relationship setup so that the jobs are related to the Projects via a Project Number, you can have something like this in a calc in the Child table (Jobs):

Ceiling ( Evaluate (WorkDate - Projects::StartDate) / 7 )

or this should work too

Ceiling (  (WorkDate - Projects::StartDate) / 7 )

Try:

Ceiling ( ( WorkDate - Projects::StartDate [color:red]+ 1 ) / 7 )

  • Author
  • Newbies

Thank you for the quick replies.

I tried both way, with and without the +1.

I get a big number, 104619.

I have this in the "invoicenumber" auto-calculated field:

Ceiling ( (WorkDate - Work Orders::ProjectStartDate +1)/7 )

I was looking for a single digit number, am I doing this right?

Thanks,

Carmelo

  • Author
  • Newbies

UPDATE:

I did not have the Project Start Date correctly in, for the records already created, it was blank, had to go back and enter a value and all new records will automatically have the correct project start date in it.

It works now.

Thanks for the help.

Carmelo

Well, 104619 is the number of weeks since January 1, 0001. So it looks like your expression << Work Orders::ProjectStartDate >> is returning a zero. Make sure your relationship is set up correctly and that ProjectStartDate field is not empty.

-- EDIT --

Ah - I see you've fixed it.

Edited by Guest

Oops. I left it so that it counted the 7th day.

Thanks for the correction Comment.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.