home *** CD-ROM | disk | FTP | other *** search
-
- Function DateComp& (Date1 As Variant, Date2 As Variant)
-
- Dim Tmp1$, Tmp2$
-
- ''''''''''''''''''''''''''''''''''''''''''''''''''''''
- '' ''
- '' DateComp Function: Compares two dates and ''
- '' returns <0 if Date1 < Date2 ''
- '' 0 if Date1 = Date2 and ''
- '' >0 if Date1 > Date2 ''
- '' ''
- '' Date values should be passed in MM-DD-YYYY fmt ''
- '' Ex: 03-24-1994. This format can be obtained ''
- '' using the Format$() function. See VB Help for ''
- '' more info on that if you're unsure. ''
- '' ''
- '' After this function exits, you can convert the ''
- '' values back to whatever date format you need. ''
- '' ''
- '' See the enclosed example in the sub main. ''
- '' ''
- '' By Richard Wray, CIS 74053,3710 ''
- '' ''
- ''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
- ' First check year value. If years are different,
- ' we know which one is greater, so exit.
-
- DateComp& = DateValue(Date1) - DateValue(Date2)
-
- End Function
-
-