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

How can we express z in this function to be any integer in order to be applied in the if function;

Let([z=any integer];

If(Year(MyDate)=2004+4.z)

Pascal

Let([z=any integer];

If(Year(MyDate)=Int(2004+Evaluate ( "4," & z ));"something";"something_else")

substitute the , with a . if you use a "x-the-pond" notation in your OS-prefs!

--sd

  • Author

Soren,

Thank you for your reply but I mean something else I think in this formula. To analyze you more this is to cover the additional days of FEBRUARY in a function.

If (Year(MyDate)=2004+m.4; 29; 28)

I mean how to indicate all the years that have one day more in February instead to write

2008,

2012

2016

etc.

This is why I need to use the multiplication of 4 in the formula but not just for one integer but for any integer that multiply 4. I hope you can understand.

Pascal

Edited by Guest

Case (Mod ( Year(MyDate) ; 4 );28;29)

But isn't there something about year 2000 not being a leapyear???

Case(Mod ( Year ; 4 ) xor 0 + Mod(Year;2000) xor 0;29;28)

--sd

1. 2000 WAS a leap year. Your formula also returns incorrect results for years 1900 and 2100, for example. I think the rules for the Gregorian calendar can be written as:

Case ( Mod ( Year ; 4 ) or not Mod ( Year ; 100 ) and Mod ( Year ; 400 ) ; 28 ; 29 )

Of course, you could let Filemaker do the work for you, since it knows about leap years:

Case ( Month ( Date ( 2 ; 29 ; Year ) ) = 3 ; 28 ; 29 )

2. What does Case ( test xor 0 ; result ; defaultResult ) mean? How is it different from plain Case ( test ; result ; defaultResult )?

If you are putting up a series of conditions to point out various locations of a Choose(

can a base-2 truthtable or mutliplexer be set up like this:

Sign(Mod(theYear;4))+

2^Sign(Mod(theYear;100))+

4^Sign(Mod(theYear;400))

It's of course not quite the point in this case, but I do in this case use Value xor 0 instead of Sign( ...becasue I with my slight of dyslexia better can read this:

(Mod(theYear;4) xor 0) +

2^(Mod(theYear;100) xor 0)+

4^(Mod(theYear;400) xor 0)

...thats all! But you are right your filemaker near approach is a much better one:

Case ( Month ( Date ( 2 ; 29 ; Year ) ) = 3 ; 28 ; 29 )

I guess this (still) has to do with enduring and perhaps sometimes even deserving teachers in greece, so your reservations here:

incorrect results for years 1900 and 2100

...are of less importance, taking the apocalyptic nightmares of Y2K in consideration, where people seeked shelter in the mountains of West Virginia with boxes of ammunitions, to prevent their expectations hitting them at first trombone blast.

--sd

I see (I think) - you want to force a value to a Boolean result. But your method is giving ME dyslexia. In version 8 and above, you could simply use GetAsBoolean(). Or, in any version, you could make it:

2^not not value

I know, but I'm getting used to the xor'ing!

--sd

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.