April 13, 200619 yr Newbies 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?
April 13, 200619 yr 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
April 13, 200619 yr 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.
April 13, 200619 yr GetAsDate ( text ) is problematic, because the interpretation of text depends on the current file/OS settings. Best to stick with the Date() function.
April 14, 200619 yr 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.
April 14, 200619 yr 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.
Create an account or sign in to comment