Letâs say that you wanted to return this value into lngHoursBetween:
Code:
Dim lngHoursBetween As Long
lngHoursBetween = datediff("h", dtDate_1, dtDate_2)
Thatâs it! Alternately:
Code:
Dim lngHoursBetween As Long
Code:
lngHoursBetween = datediff("h", "05/01/2005", "05/03/2005") ' Returns 48.
lngHoursBetween = datediff("h", "05/01/2002", "05/03/2005") ' Returns 26,352.