The approaches that have been offered work if you don't want to take the year
into account as well. In other words, if you want August 9, 2004 to equal
August 9, 2005, you can simply compare the .Month property of the DateTime
objects.
However, the following example accounts for months AND years. It is a
little bit longer, but very straightforward.
'Start with your original DateTime values
Dim date1 As DateTime = DateTime.Parse("August 5, 2004")
Dim date2 As DateTime = DateTime.Parse("February 1, 2005")
'Create "Month-Only' versions of those values
Dim month1 As New DateTime(date1.Year, date1.Month, 1)
Dim month2 As New DateTime(date2.Year, date2.Month, 1)
'Now compare
If month1 < month2 Then
MsgBox("less")
ElseIf month1 > month2 Then
MsgBox("more")
Else
MsgBox("equal")
End If