Focal Point
Find earliest date across columns

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1881009331

October 20, 2005, 08:25 AM
<Unfocused>
Find earliest date across columns
Is there a way to determine the earliest (or latest) date from a set of columns in a single row ?

Date1 Date2 Date3
10 Mar 05 12 Sep 04 31 Dec 04


Something like EARLIEST(date1, date2, date3)
that would return 12 Sep 04?

thanks
October 20, 2005, 12:00 PM
susannah
Un, did you check out the MIN function?
MIN(date1,date2,date3)
Different from MIN.fieldname prefix thing, this MIN function takes a vector of values..
October 20, 2005, 04:31 PM
Noreen Redden
TABLE FILE fn
PRINT DT1 DT2 DT3 COMPUTE MDT/DMTY = MIN(DT1,DT2,DT3);
END Just remember that this will only work if DT1, DT2 and DT3 are defined as "smart dates" ie format of DMTY. If they are I6DMTY, then the minimum fvalue will be 10 MAR 05 . If that is the case, just use DEFINE to put them into a DMTY field.
October 27, 2005, 09:19 AM
<Unfocused>
Thanks for your replies.
MIN works perfectly.