Jump 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.

Featured Replies

Hi all

If the users enters a year and week, I want to calculate the startdate and enddate of this year/week.

In another helpfile I found the following code:

Date(1;2 - DayofWeek(Date( 1; 0; Year(Get(CurrentDate))));Year(Get(CurrentDate))+ 7 * (Week - 1)

But that doesn't work. (I don't even know what it is trying to do).

Can anyone help me with this?

Thx

Sabrina

Edited by Guest

  • Author

The formula does work, but only when I use a OnObjectModify-script to calculate start/enddate of the week.

At first I had the formula in the database as a auto-enter calculated value of a date-field.

Why didn't it get triggered in the database?

I found out that nothing I entered (not even get(currentdate) in the database was executed.

When do these options get triggered in the database? I am confused now.

Sabrina

If the users enters a year and week, I want to calculate the startdate and enddate of this year/week.

In another helpfile I found the following code:

Date(1;2 - DayofWeek(Date( 1; 0; Year(Get(CurrentDate))));Year(Get(CurrentDate))+ 7 * (Week - 1)

Since the formula does not use a year parameter as input, it cannot produce the required result.

There are some questions here which need to be clarified:

1. What is the "week" that your users enter? Is it the same as Filemaker's WeekOfYear(), or is it perhaps using another method? How do your users know the week number to enter?

2. What is the purpose of this calculation?

As comment stated, you need to provide some additional information.

Why didn't it get triggered in the database?

I found out that nothing I entered (not even get(currentdate) in the database was executed.

When do these options get triggered in the database? I am confused now.

Auto Enter does not effect existing records.

Also, be sure that you have deselected the option "Do not replace existing value of field (if any)"

  • Author

1. The week the user enters is a 2-digit number with a valuelist from 1-53.

2. The purpose is to get the startdate and enddate for the week the user enters. (The also enter the year which is a 4-digit number with a valuelist from 1990-2020 with possibility to edit more).

I need it for hour-registration purposes.

That doesn't answer my questions. How do they know which week number to pick?

I need it for hour-registration purposes.

That doesn't tell me anything.

As I hinted earlier, there are various methods to calculate the week-of-year from date; Filemaker alone has two functions for this, which together can produce 8 different results for the same given date. You cannot reverse the calculation without knowing what it was in the first place.

Create an account or sign in to comment

Important Information

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

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.