Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6860 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I am having some weird results. I have a calculation that is

if(ReadingDate<10/31/2005,"Y","N")

when I enter a date that is less than 10/31/2005 it returns "N" everytime. The weird thing is that if I use greater than, it resolves correctly.

Any ideas?

Posted

The use of 10/31/2005 is NOT a date.

You must use the function

Date (month; day; year)

to generate a date that can be used for comparison purposes

HTH

Posted

I generally use the GetAs function probably a little too much, but I like to be sure that the calc works the way I intend it too, in your case I would do.


If(GetAsDate(ReadingDate) < GetAsDate("10/31/2005"); "Y"; "N")

Again, thats not normally neccessary for when your refrencing a field that is set up as a date, but when you start using variables, and say, global fields, or text fields, I think its a good idea to include it.

Posted

GetAsDate ( text ) is problematic, because the interpretation of text depends on the current file/OS settings. Best to stick with the Date() function.

Posted

GetAsDate ( text ) is problematic, because the interpretation of text depends on the current file/OS settings. Best to stick with the Date() function.

Comment,

I've never had any problems with this. Could you give me a scenario where this could become problematic?

Just want to make sure this won't cause issues in any of my other files.

Posted

For example, GetAsDate("10/12/2005") returns the date of December 10, 2005 - if the file/OS is set to use the m/d/y format. The same calculation returns a "?" if the date format is d/m/y.

This topic is 6860 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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