R
RT_Indy
I am in need of some help with a function. I have 5 columns, with each of
the 5 being a date field. I need a function that will return the minimum date
of the 5. I have found code on this board that works beautifully with 3
columns, but I don't understand VB programming/logic and haven't been
successful modifying the code I found (posted below) to work for 5 columns.
Is there anyone that can help me out? It seems simple for someone who
understand VB - but unfortunately that is not me.
Public Function MyMin(dte1 As Date, dte2 As Date, dte3 As Date) As Date
If dte1 <= dte2 Then
If dte1 <= dte3 Then
MyMin = dte1
End If
Else
If dte2 <= dte3 Then
MyMin = dte2
Else: MyMin = dte3
End If
End If
End Function
the 5 being a date field. I need a function that will return the minimum date
of the 5. I have found code on this board that works beautifully with 3
columns, but I don't understand VB programming/logic and haven't been
successful modifying the code I found (posted below) to work for 5 columns.
Is there anyone that can help me out? It seems simple for someone who
understand VB - but unfortunately that is not me.
Public Function MyMin(dte1 As Date, dte2 As Date, dte3 As Date) As Date
If dte1 <= dte2 Then
If dte1 <= dte3 Then
MyMin = dte1
End If
Else
If dte2 <= dte3 Then
MyMin = dte2
Else: MyMin = dte3
End If
End If
End Function