Home > Net >  How to determine the input date in small white, VB not input in the year
How to determine the input date in small white, VB not input in the year

Time:09-24

Such as the annual input 2020, how do you determine the input date is in 2020 between April and march of 2021,

The input date of date is dat. Text

Is input to the annual YEAR

CodePudding user response:

String can change my judgment, call ready conversion function,

CodePudding user response:

Can participate

CodePudding user response:

Dim date1 and date2 As DateTime
Date1=Date. Now 'to the Date you entered here
Date2=New DateTime (2020, 3, 1)
Dim monthDiff As Integer=DateDiff (" M ", date1 and date2)
If monthDiff=0 Or monthDiff=1 Then
MsgBox (" right ")
The Else
MsgBox (" error ")
End If
  • Related