If (txtResponseDate <> " ") Then
IssuedDate = txtDateIssued 'gets date from txtfield
ResponseDate = txtResponseDate 'gets date from txtfield
ResponseTime = ResponseDate - IssuedDate
Time1 = Format(ResponseDate, "hh:mm") 'get hour/min portion
Time2 = Format(IssuedDate, "hh:mm")
txtResponseTimeMin = Format(ResponseTime, "hh : mm")'displays hour/min
If (Time1 < Time2) Then
'txtResponseTimeDays = DateDiff("d", IssuedDate, ResponseDate)
Time1 = DateDiff("d", IssuedDate, ResponseDate)
Time2 = DateAdd("d", -1, Time1)
txtResponseTimeDays = Format(Time2, "d")
Else
txtResponseTimeDays = DateDiff("d", IssuedDate, ResponseDate)
End If
End If
I am trying to figure out how to get the right day. for example IssuedDate = 4/15/2005 5:08 PM and ResponseDate = 4/16/2005 5:07 PM. my result is 1 day, 23 hours and 59 min, when its suppose to be 0 days. i cant figure it out. please help
IssuedDate = txtDateIssued 'gets date from txtfield
ResponseDate = txtResponseDate 'gets date from txtfield
ResponseTime = ResponseDate - IssuedDate
Time1 = Format(ResponseDate, "hh:mm") 'get hour/min portion
Time2 = Format(IssuedDate, "hh:mm")
txtResponseTimeMin = Format(ResponseTime, "hh : mm")'displays hour/min
If (Time1 < Time2) Then
'txtResponseTimeDays = DateDiff("d", IssuedDate, ResponseDate)
Time1 = DateDiff("d", IssuedDate, ResponseDate)
Time2 = DateAdd("d", -1, Time1)
txtResponseTimeDays = Format(Time2, "d")
Else
txtResponseTimeDays = DateDiff("d", IssuedDate, ResponseDate)
End If
End If
I am trying to figure out how to get the right day. for example IssuedDate = 4/15/2005 5:08 PM and ResponseDate = 4/16/2005 5:07 PM. my result is 1 day, 23 hours and 59 min, when its suppose to be 0 days. i cant figure it out. please help