drbott Posted March 10, 2007 Posted March 10, 2007 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.
LaRetta Posted March 10, 2007 Posted March 10, 2007 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 Shadow Posted March 10, 2007 Posted March 10, 2007 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.
drbott Posted March 10, 2007 Author Posted March 10, 2007 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.
The Shadow Posted March 10, 2007 Posted March 10, 2007 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.
Recommended Posts
This topic is 6529 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 accountSign in
Already have an account? Sign in here.
Sign In Now