Skip 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.

Greater than date in a IF statement trouble

Featured Replies

  • Newbies

Hi. I am trying to create an IF statement to determine if the Date Booked for an event is greater than 1/31/2012 AND if the record is tagged a certain company.

Right now I have...

If [services::Date Booked > 1/31/2012 and Event::INC_LLC = "LLC"]

Problem is, if it is an LLC event, it always validates true regardless of what the date is. What am I missing? Thanks, Rich

1/31/2012 isn't a date.

Try: Date Booked > Date ( 1 ; 31 ; 2012 )

  • Author
  • Newbies

Perfect. You're the best!

If [services::Date Booked > 1/31/2012 ...

it always validates true regardless of what the date is. What am I missing?

Hi Rich,

To explain why the evaluation is breaking, FM sees 1/31/2012 as '1 divided by 31 divided by 2012'. The result is: .0000160328352466. So any Date Booked would evaluate as greater (except if empty). When working with dates, using date functions protects from this.

And welcome to FM Forums!! :laugh2: This is absolutely the best forum for FileMaker.

an event is greater than 1/31/2012

Not directly related to your question, but in general it's best to avoid coding data directly into a calculation.

Indeed, if I ran that calculation it'd fail (or produce very unexpected results) because that date is the 1 day of the 31st month in 2012.

Indeed, if I ran that calculation it'd fail (or produce very unexpected results) because that date is the 1 day of the 31st month in 2012.

Which calculation do you mean?

I think Vaughan is referring to australian date structure as being dd/mm/yy as distinct from the OPs mm/dd/yy

I think so too - but the first calculation performs a division and the second one uses the Date() function. The results would be the same no matter which date format is in use.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.