VB中怎样比较两个日期的大小
发布网友
发布时间:2022-04-25 15:17
我来回答
共3个回答
热心网友
时间:2023-10-11 23:35
date1 = "2010-10-10 12:14"
date2 = "2011-2-3"
If DateDiff("d", CDate(date1), CDate(date2)) < 0 Then
MsgBox date1 & "大"
Else
MsgBox date2 & "大"
End If
热心网友
时间:2023-10-11 23:35
dim later
date1 = "2010-02-02"
date2 = "2009-01-01"
if datevalue(date1) > datevalue(date2) then
later = cdate(date1)
else
later = cdate(date2)
end if
msgbox "较大的日期是" & later
热心网友
时间:2023-10-11 23:36
If CDate(