Identify latest date in each record

4 posts / 0 new
Last post
salman.qasim
Offline
Joined: 07/03/2014 - 09:24
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 07/03/2014 - 09:24

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

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Not a problem Salman, glad I could help.