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.

Date calculation problem

Featured Replies

I figured I would ask the experts for help.

I want to know how many months accumulate after a person registered for a particular course. I have two fields; 1) Registration = (date field) and 2) Total = (calculation field). I can make the calculation show the correct amount of days but not the months. I made the calacuation as follows: Status( CurrentDate) - Registration. The calculation result option was set to "number." I would appreciate all the help you could give me.

Steve

How do you define a month, 30 days, 31 days, 28 days?

There are, on average, 365/12 = 30.42 days/month. So Months = ( Status(CurrentDate) - RegistrationDate ) / 30.42. This is approximate, of course. You could loop through the months, add them individually, and get a fraction for the final month.

  • Author

I would say 30 days.

Then divide the numbers of days by 30 to get the total number of months, the way Ronald did with 30.42.

  • Author

I tried ( Status(CurrentDate) - RegistrationDate ) / 30.42 and got the following result. 707789.619329

What's your sample RegistrationDate?

  • Author

A date field without any options selected.

Status( CurrentDate) - (date verified) / 30.42

The date verified is the date field.

  • Author

The date verified is the registration date.

Um, I mean what is the specific date in your sample?

I am trying to sort data per each layout. Filemaker just seems to sort the entire database. Anyone know how to fix this problem? Also, I would like to know how to sort data based on the color of the text. Anyone know how this can be done? Anyone know how to add toggle buttons?

  • Author

I somehow fixed the problem. I made another calculate field and divided 30.42 into the results from the previous calculation field and got the answer showing the number of months instead of days.

Sorting affects the entire current found set. If you don't want data to be sorted, you'll have to either find a particular set or omit the unwanted ones before sorting. Data isn't tied to a layout. You will have to set up a particular sort to be performed, depending on which layout you are accessing.

I'm not sure what you mean by sorting based on text color.

What sort of toggle do you want?

FileMaker sorts the found set. Find the records you want, then sort them.

I don't think you can sort on the color of text. Although, FileMaker 7 has a GetAsCSS ( text ) function that possibly could be parsed and used for sorting. You'd have an easier time coloring the text based on a calculation, and using that data the calc is based on for the sort.

By toggle buttons, you mean a button that changes its appearance? You can create a calculated container field for that. E.g.: Case( status = "on"; gON; gOFF) where status is a text or number field that is set as part of a script when you click the button, and gON and gOFF are global container fields.

Wow, posted at the same minute!

It's an ambush of animated gifs.

Does anyone know if I can add a clickable link to a report? I would like to add a url to the report that will allow me to go to the webpage. Thanks.

Is the URL static or dynamic? If static, use the Open URL script step, hard-coded with the desired URL. If dynamic, use the step with the field name instead of text.

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.