Jump to content

This topic is 8590 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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.

Posted

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.

Posted

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.

Posted

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

This topic is 8590 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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