比較元の日付と時間、比較先の日付と時間をセットして、時間が比較元より小さいか大きいかを判定する

<分類:判定>
<使用例:比較元の日付(2018/11/10)と時間(23:59:59)、比較先の日付(2018/11/11)と時間(00:00:00)をセットして、時間が比較元より大きいので大と判定する>
<例外:比較元の日付と時間、比較先に日付と時間が同じだった場合は、小にしている
<プログラム例>

Sub 使用例()
   Dim fdate As Date
   Dim ftime As Date
   Dim tdate As Date
   Dim ttime As Date
   
   Dim rtn1 As String

   fdate = "2018/11/10"
   ftime = "23:59:59"

   tdate = "2018/11/11"
   ttime = "00:00:00"

   rtn1 = 時間大小判定(fdate, ftime, tdate, ttime)

   MsgBox (fdate & " " & ftime & " と " & tdate & " " & ttime & " を比較した結果は" & rtn1 & "です")

End Sub

Function 時間大小判定(fdate As Date, ftime As Date, tdate As Date, ttime As Date)

    If DateDiff("d", fdate, tdate) > 0 Then
       時間大小判定 = "大"
    End If

    If DateDiff("d", fdate, tdate) = 0 Then
       
       If DateDiff("s", ftime, ttime) > 0 Then
          時間大小判定 = "大"
       Else
          時間大小判定 = "小"
       End If
    End If

    If DateDiff("d", fdate, tdate) < 0 Then
       時間大小判定 = "小"
    End If
    
End Function