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

I am using a series of FMP-IF statements to display my records on my

website.

One of the FMP statements is comparing the date of two FMP-fields with

eachother and displays the one that is most recent.

Well, that's what it is supposed to do, anyway. However, there seem to be

some problems with that.

The IF-statement I use is this:

[FMP-IF: Field:responses::ResponseDate .gt. Field:mm_stats::PostDate]

some action

[FMP-ELSE]

some other action

[/FMP-IF]

In the example I am having difficulties with, the ResponseDate is 1/8/2001

and the PostDate is 28/7/2001. If I am not mistaken, the IF statement should be true and therefore the first action should take place. Right? Well, that's not what happens! For some reason the second action is taking place.

It almost seems as if Filemaker thinks the 1st of August 2001 is not greater than the 28th of July 2001.

Could it be the format of the date that makes difficulties? It is weird. The IF-statement sometimes works and sometimes doesn't I can't really figure out what differs the dates from eachother. I think it is the month in the date - if that is different between ResponseDate and PostDate, the IF-statement doesn't work the way it should.

Can anybody help?

Andreas,

I'm guessing that the IF statement is using the string values of the date. Unfortunately, I don't have a solution right at the moment.

Garry

Whenever I get tricky stuff like this, I try to do it in the database rather than the web page. Make a calc field in the db and display the result on the web page.

It may be that .gt does not work on dates. If so you may need to calculate to a number or a text field. Or set the calculation in the database if you can such that the difference is worked out there as perhaps a boolean.

  • Author

I've taken your advice and created a new field in FM wher I make the caluclation. Works fine now, thanks.

I was just wondering whether anybody knew where the problem was because it worked fine until the moment the month in the two dates differed from eachother.

Well, it's working now and I am actually quite happy to get rid of this incredible FMP-IF statement I had in my files.

Andreas asked:

I was just wondering whether anybody knew where the problem was because it worked fine until the moment the month in the two dates differed from eachother.

I believe this is because it was looking at string versions of the date.

Garry

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.