I have a piece of code and I'm trying to compare the date and time of the observation term entries but it appears MEL is reading it as text and not as a date time. Does anybody know how I can get this to read the time accurately?
{if last_signed_obs_datetime("IMLOCSECTION") > last_signed_obs_datetime("RELEASE DATE") then "" else last_signed_obs_value("RELEASE DATE") endif}
As an example if the last observed date and time for IMLOCSECTION is 10/15/2019 11:34:00 and the release date is 10/15/2019 6:19:00 it is still pulling the release date
Try this. I've surrounded your references to last_signed_obs_datetime with the VAL data symbol. In the original fn the > operator is behaving as though it's a string comparison which doesn't behave quite the way people anticipate. I'm sort of surprised that my function below works so be sure to test it thoroughly as I only tested once.
{if val(last_signed_obs_datetime("IMLOCSECTION")) > val(last_signed_obs_datetime("RELEASE DATE")) then "" else last_signed_obs_value("RELEASE DATE") endif}
This would probably work too:
{if DURATIONDAYS(last_signed_obs_datetime("IMLOCSECTION"),last_signed_obs_datetime("RELEASE DATE"))< 0 then "" else last_signed_obs_value("RELEASE DATE") endif}