Click to See Complete Forum and Search --> : grab greatest date in array-vbscript


mcrpds
03-10-2005, 05:00 PM
attention gurus,
i want to create and store an array of dates in vbscript from an access database then spin thru the array and grab the latest date. my problem is 10/2/2004 is larger than 1/1/2005 if i do a straight '>' than logic. thanks in advance for your input.

mytrash@verizon
03-25-2005, 02:29 AM
Try this:


option explicit

dim dt1, dt2

dt1 = cdate( "10/2/2004" )
dt2 = cdate( "1/1/2005" )

msgbox dt1 & " < " & dt2 & " is " & ( dt1 < dt2 )