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.

Logical "if" field based on date in another field

Featured Replies

  • Newbies

I want to create a field that will return a "1" if the date in another field is after 1/1/2005 and return a "0" if the date is prior to 1/1/2005.

The argument in the logical functions do not seem to be able to treat a date like a number. If I enter (If "date field">1/1/2005, 1,0) for the calculation for the field I want to create, FileMaker does not seem to under stand the > or the < as greater than or less than in relation to dates. What is the "language" you need to use in a formula that indicates "before or after" a given date?

Steve

Try this

Case(date field >Date(1; 1; 2005); 1;0)

HTH

Lee cool.gif

In fact, in honor of JT (-Queue-) you can drop the Case() entirely. Make the calculation number:

datefield > Date(1;1;2005)

This uses Boolean logic and produces a 1 or 0 automatically. On a calculation such as this it doesn't matter (and that's why Lee didn't bother with it) but for more complex calculations the savings can add up and it also is a bit cleaner to write.

Sometimes a simpler example shows a principle more clearly. The Boolean logic in more complex formulas then stands out for you and that's my only reason for mentioning it. It's a good understanding to have in your arsenal.

JT was the king of Boolean logic and I miss his fine-tuning. smile.gif

LaRetta

Hi LaRetta,

I-Agree.gif

I sure miss -queue-.

Lee

cool.gif

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.