Tuesday, July 15, 2008

Compare Date Function

Function Compare_Date(InacDate,CurrentDate)
If int(year(InacDate) ) > int(year(CurrentDate) )Then
Comp = 0
Else If int(year(InacDate) ) = int(year(CurrentDate) )Then
If int(month(InacDate) ) > int(month(CurrentDate) )Then
Comp = 0
Else
If int(month(InacDate) ) = int(month(CurrentDate) )Then
If int(day(InacDate) ) > int(day(CurrentDate) )Then
Comp = 0
Else
Comp = 1
End If
Else
Comp = 1
End If
End If
Else
Comp = 1
End If
End If
End Function

No comments: