March 12, 200916 yr Hello Team, I need to compare two dates and determine which is the "newer" date. For example, I have a field called "ExitDate". I need to compare whatever the date is in ExitDate, which may be June 19, 2009, and compare it with todays date and determine which is "newer" and place the result in a field. I can't see how to create what must be an "if/then" statement of some sort. Let me know what you think. - Sez
March 12, 200916 yr Assuming ExitDate is a date field: Case ( Get (CurrentDate) > ExitDate ; "Expired" ; "Not yet" ) Or: Choose ( 1 + Sign ( Get (CurrentDate) - ExitDate ) ; "Future" ; "Today" ; "Past" )
March 12, 200916 yr Oh, was THAT the question? BTW, if the result is date, then GetAsDate() is not required.
March 12, 200916 yr Author Hello Team, First, thanks for such a quick reply! This really SMA! I used the following; GetAsDate(Min(ExitDate; Get(CurrentDate))) In a calculation field substituting Min for Max and its a perfect solution. Thank you. If I understand this correctly it is saying; "Return a date - the "earliest" of the following two dates - exitdate and todays date." This way, if there is a date in the exit date field that is earlier than todays date, it leaves it alone. Which is exactly what I'm looking for. Again, thank you. I think the other code posted here is interesting as well, and can see other applications for the concept. I will take note of it. - Sez
Create an account or sign in to comment