Compare dates to Determine which one is Later

Category:
Dates and Math
Type:
Snippets
Difficulty:
Beginning
Author:
Ervin Kosch

Version Compatibility: Visual Basic 5

More information:
This code compares 2 dates. If Date1 is greater the function returns the number 1. If Date2 is greater the function returns the number 2. If Date1 equals Date2 the function returns the number 0 The main reason I created this function was to compare several file dates in conjunction with a bubble sort. However this will allow you to compare any 2 dates for any reason.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: