Skip to main content

Identify latest date in each record

Hi all,
Hoping someone can help with this query. I have database which contains 4 diffrent date fields. I want to compare the the 4 dates of each record and output the latest into a new field called latest date.
Can anbody advise how I would go about tackling this?
Any help would be much appreciated.
Kind Regards,
Salman

Brian Element Wed, 07/08/2015 - 10:09

Hi Salman,

This is not the easiest thing to do in the equation editor but it is quite easy to do using a custom function.  I have attached one that should help you out.  Just download it and in your project folder (assuming IDEA v9) save it to your Custom Functions.ILB folder.  Now when you go and create your new field you can access the custom function in the equation editor by typing #LastestDate and the syntax would be:

#LatestDate(dateField1, dateField2, dateField3, dateField4) and it will return the lastest date of the 4. 

I haven't tested the function that much so I will leave it up to you to make sure it is working properly by doing some comparisons of your data.

Thanks

Brian

salman.qasim Wed, 08/05/2015 - 08:45

Hi Brian,
Sorry for not replying sooner.
Just wanted to let you know that your solution worked a treat.
Thanks again for your efforts, it's much appreciated.
Regards,
Salman