Function dateRQ(inpStartDate As Date, inpEndDate As Date, startDate As Date, endDate As Date) As Integer
Dim intW%
If endDate & "" = "0:00:00" Then
endDate = inpEndDate
intW = 1
End If
If endDate < inpStartDate Then '如果查询日期已超过归还期,返回0
dateRQ = 0
Exit Function
End If
If inpStartDate < startDate Then inpStartDate = startDate '如果查询起始日期早于出借起始日期,调整查询起始日期
If inpEndDate > endDate Then inpEndDate = endDate
dateRQ = inpEndDate - inpStartDate
If dateRQ < 0 Then
dateRQ = 0
Exit Function
End If
dateRQ = IIf(inpEndDate - inpStartDate > 0, inpEndDate - inpStartDate, 1) + intW
Application.Volatile
End Function