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

Simple Date Calc, am I crazy?

Featured Replies

OK, I'm doing a simple check compared the the current date so my data set can expand as time passes. I'm doing them in quarterly increments. When I'm doing my arguments, it works fine for April and July, but when I get to October it reports as true.

Get ( CurrentDate ) > "4/1/2007" result 0

Get ( CurrentDate ) > "7/1/2007" result 0

Get ( CurrentDate ) > "10/1/2007" result 1 :)??

Can someone else try these and see what you get? I've tried it on two clients and both do the same thing.

I can't understand what you want here ...

"so my data set can expand as time passes" but you are hard-coding the year within the calc???

Are you just trying to determine what quarter you are currently in?

Let ( d = Get ( CurrentDate ) ;

Case (

Month ( d ) < 4 ; 1 ;

Month ( d ) < 7 ; 2 ;

Month ( d ) < 11 ; 3 ;

4

)

)

If this isn't what you need, please explain it in different words. :wink2:

The reason your calc is working funny are the quotes, that makes things into strings, not dates, something like:

  Get(CurrentDate) > GetAsDate("4/1/2007")

would make more sense.

  • Author

Ah, that fixed it. GetAsDate made it work correctly. I'm still confused why FileMaker reports this as being true when clearly today isn't greater than October 1st.

Get ( CurrentDate ) > "10/1/2007"

Been using FM since version 2 and it is always simple things like this that perplex me.

Thanks for the help.

It's doing a string compare on "3/9/2007" verus "10...", and "3" is > "1", so this returns true. Adding the GetAsDate() makes them compare as actual dates, which is what you meant.

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.